views:

201

answers:

2

Hi

I have a panel that has lots of labels and checkboxes. I want to grab all these controls and resize them?

How would I do this? Would this be like going through the panel for all the controls then resizing them?

Or do you think it would be better to re render the whole form again with the new sizes. However this would require me to do another request to the webservice to get the information.

I need to resize the controls because I want allow user to switch from portrait mode to landscape.

+2  A: 

Use Dock, or for more precise control use the Anchor property. By setting Anchor to Left, Right, Top, Bottom the control will scale with the window. By setting Anchor to Right the control will move with the right border. By setting Anchor to Top and Bottom the control will scale vertically, but have a fixed width. you can also use tablelayoutpanel and flowlayoutpanel controls. For mobile, I think these controls are not available.

Brij
A: 

First of all, you should not just store the values from the web service in controls. They should be safely tucked away in one or more objects somewhere, to be easily accessed from your form.

I'm afraid you ahve to resize and/or change location of your controls depending on which mode you are in.

For developing resolution aware applications for .NET CF, see here: http://msdn.microsoft.com/en-us/library/ms838174.aspx