开发者

Controls change place and form size changes

开发者 https://www.devze.com 2023-03-28 01:52 出处:网络
I have designed a form in VB.NET.At design time I have placed two buttons on it. When I run it, the form size looks smaller and the buttons I have placed at the bottom are not visible.Also the alignme

I have designed a form in VB.NET. At design time I have placed two buttons on it. When I run it, the form size looks smaller and the buttons I have placed at the bottom are not visible. Also the alignment of the text and picture box is also different from what I set at design开发者_StackOverflow中文版 time.

Computer at which I

Controls change place and form size changes

am running the form is using a different resolution.


change the properties (F4) of the buttons: in ANCHOR put Bottom, Right your buttons will be tied to the bottom and the right of the screen, instead of to the top, left, which is the default.


Grab the screen size at runtime with

Dim screen as System.Windows.Forms.Screen = System.Windows.Forms.Screen.PrimaryScreen

and using a scale factor depending on the current size (in design), scale the window to match. Check the coordinates of the buttons by hand to make sure they are not outside of the visible portion of the window.

You may not have to leave this feature in if you can debug it to the point that you know the exact resolution that you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消