Changin proportions on objects on Form SizeChange

L

Lars Netzel

I have my three datagrids on a form (created in VS design view) and I want
them to grow and have the same space from each other when I maximize or
resize the form they are in.

I know there's a docking property but it's nto enough.. since I have three
grids that ar supposed to be aligned verticaly and if the top one gets a
bigger Height it will grow OVER (or under) the next one... I need therey
space in between to be the same, which means moving the nextone...

any tips?

Right now I'm using, but I asume there are better ways of doing this?

DataGrid1.Width = Me.Width - 100
DataGrid2.Width = Me.Width - 100
DataGrid3.Width = Me.Width - 100

/Lars
 
H

Herfried K. Wagner [MVP]

* "Lars Netzel said:
I have my three datagrids on a form (created in VS design view) and I want
them to grow and have the same space from each other when I maximize or
resize the form they are in.

I know there's a docking property but it's nto enough.. since I have three
grids that ar supposed to be aligned verticaly and if the top one gets a
bigger Height it will grow OVER (or under) the next one... I need therey
space in between to be the same, which means moving the nextone...

any tips?

Right now I'm using, but I asume there are better ways of doing this?

DataGrid1.Width = Me.Width - 100
DataGrid2.Width = Me.Width - 100
DataGrid3.Width = Me.Width - 100

Notice the controls' 'Anchor' property.
 
L

Lars Netzel

Thnkx, I guess I can use a combination then cause the anchor is not really
acting the way I want!

/Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top