Hello people,
I am facing a great challenge. In my program there is a form which contains a panel, which contains several controls (datagrid, textbox, combobox...). For some reason the panel sometimes need to be portait, en other times landscape. That is not really difficult, but the controls need to be rearranged when the panel changes from landscape to portait and the other way arround. That can be done by setting the position and size of every control. Now come the challenge, how (or where) do I store the information about the 2 sizes and location of every control. I don't want to have a methode like this:
Because that would mean that if I change someting in the desinger this method to.Code:private void rearrangeControles(bool landscape) { if (landscape) { this.tbxClient.Size = new Size(10,100); this.tbxClient.Location = new Location(5,7); } else { this.tbxClient.Size = new Size(5,30); this.tbxClient.Location = new Location(15,20); } .... }
Anybody has a clue....




Reply With Quote