How to scale form controls to fit the form?

I have a 2010 visual base form with various group boxes, buttons, and shortcuts. I want to have the maximum shape, but when I do this, the controls stay where they are, and they do not change depending on the form. I want them to change shape proportionally. Any help would be appreciated.

+3
source share
5 answers

I actually ended up using the table layout panel to arrange everything to fit the screen. It works great if your controls are in a grid.

+1
source

ResizeEnd Resize, . , , .

+2

1 ,

gb_check -

height, location and width Groupbox

 Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
            gb_chek.Height = (Me.Height * 30) / 100 'what ever be the form height the group box height is always 30% of the form size
            gb_chek.Width = (Me.Width * 40) / 100 'what ever be the form width the group box width is always 40% of the form size
            gb_chek.Location = New Point((Me.Width) / 18, (Me.Height) / 12)' set the location of the form relative to form size;
 End Sub

,

+1

! , , .net! - - .

0

Dim res As New SizeF (Screen.PrimaryScreen.WorkingArea.Width/Me.Size.Width, Screen.PrimaryScreen.WorkingArea.Height/Me.Size.Height)       Me.Scale()

0
source

Source: https://habr.com/ru/post/1777790/


All Articles