cmdolcet
asked on
How to resize a form and its different controls.
I have a form that has a multitude of controls on it ( Labels,TExtbox,combo box, grids radio button and group boxes). I would like a streamline way on how to easily resize a form based on the users screen size.
I have the following code:
I also changed the following properties on the form itself.
AutoSize = True
AutoSizeMode = GrowAndShrink
Do I need to to anything with the labels and textboxes and combobox ?
I have the following code:
Dim X as Integer= my.computer.Screen.Bounds.Height
Dim Y as Integer = my.computer.screen.bounds.width
Sub FrmLoad ()
me.size = new size(X,Y)
I also changed the following properties on the form itself.
AutoSize = True
AutoSizeMode = GrowAndShrink
Do I need to to anything with the labels and textboxes and combobox ?
what do you want to happen on labels and textboxes? Often, we set the Anchor property to extend to the right to the textboxes so they extend to resize to the form accordingly.
ASKER
Yes I should of mentioned that in the first place. I would like each control to resize the position on the form so things dont get cut off.
For example.
I have a status bar and a progress bar both are set to dock to the bottom and anchored (Top Left) when I add this code:
With the form properties set to:
AutoSize = True
AutoSizeMode = GrowAndShrink
It seems to cut off my status bar and progress bar?
For example.
I have a status bar and a progress bar both are set to dock to the bottom and anchored (Top Left) when I add this code:
Dim X as Integer= my.computer.Screen.Bounds.Height
Dim Y as Integer = my.computer.screen.bounds.width
Sub FrmLoad ()
me.size = new size(X,Y)
With the form properties set to:
AutoSize = True
AutoSizeMode = GrowAndShrink
It seems to cut off my status bar and progress bar?
Anchoring is useless when docking.
I am not sure to understand what you mean. Do you have test code you can share? or an image?
I am not sure to understand what you mean. Do you have test code you can share? or an image?
ASKER
Give me until next week to get something together as a true example.
Thanks,
Thanks,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So If I dock a control say a panel tat is docked to the form and inside that panel I have other controls (labels, radio button) those will get resized with the panel.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is there any way you could provide an example using a panel and a couple of controls inside that panel.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I use a dll called Softgroup .Net Forms Resize to resize the controls on my forms. It does a great job. They have a free trial version.
From there, you can use the Anchor property on controls to determine how a control resized / moves when a form size changes.