Archived

This topic is now archived and is closed to further replies.

Auto Re-sizing controls in VB.NET

This topic is 5011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using Visual Studio .NET and Visual Basic .NET to make a program and if I try to resize it or maximize the program, none of the control sizes change and the rest of the window just shows up as the default background. Is there a way I can set it so that all the controls in the form autoscale to a percentage of the size of the full window? I tried setting the autoscale property to true, but apparently thats just for resizing in comparison to font size, not actual form size. In VB 6.0 there were .ScaleWidth and .ScaleHeight functions you could use, but they dont exist in .NET, so I''m kind of lost on this one. Anyone have any ideas?

Share this post


Link to post
Share on other sites
I think controls have a scale method that can take two arguments, one for height and one for width. I''m not familiar with 6.0, but these should do what .ScaleWidth and .ScaleHeight did back there.

Share this post


Link to post
Share on other sites
that sort of helps a little, but thats still not what I''m trying to do...

I''m trying to resize the entire window so that everything scales to a new size, for use on multiple resolutions.

the dock property only scales stuff that you want pushed against an edge and the anchor property doesnt scale anything at all, it just makes the distance between control borders and window borders constant.

are there any ways to actually autoscale and resize controls?

Share this post


Link to post
Share on other sites
quote:
Original post by save yourself
the anchor property doesnt scale anything at all, it just makes the distance between control borders and window borders constant.

Try anchoring to all four sides of the form. For the control to keep the distance between itself and all of the form borders constant, it must resize.

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]

Share this post


Link to post
Share on other sites