resize more than one control proportion

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

I have to DataGrid's on a form, one on the top of my form, the other at the
bottom, but they though each other somewhere in the middle. What I want now
is that, when I resize the form, they resize in the same proportions: So
when I resize the Form with 50%, they each have to resize with 50%.

The maximum what I can achieve now is that one of them resizes, and the
other keeps the same height, if I don't do it like that one of the
DaatGrid's comes in front of the other.

Any help would be really appreciated!

Thansk a lot in advance,

Pieter
 
Hi Peiter,

create a new form, size=640;424, than place 2 datagrids on it, datagrid one
at the location 0;0 and size:632;200 and datagrid 2 at location 0;200 and
the same size, then copy paste the following code and see if this is what
you want:

<<<<<code>>>>>>>>

Private Sub Form1_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) _ Handles MyBase.Resize
DataGrid1.Width = Me.Width - 8
DataGrid2.Width = Me.Width - 8
DataGrid2.Height = (Me.Height - 24) / 2
DataGrid1.Height = (Me.Height - 24) / 2
DataGrid2.Location = New Point(0, DataGrid1.Height)
End Sub

<<<<<code>>>>>

hth Peter
 
Back
Top