Click to See Complete Forum and Search --> : resize....


ant
July 9th, 2001, 04:11 PM
I have a project. When the control is resized it's supposed to resize an msflexgrid and 3 command buttons. The msflexgrid is supposed to be on top and the buttons on the bottom. I want when i resize the control it resizes the msflexgrid and the command buttons, so they appear in the same appearence just like they were as large as they were normally. Help please!

--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: christopherfolger@hotmail.com
for the address

John G Duffy
July 9th, 2001, 07:01 PM
Your UserControl has a Resize event. In it is where you want to recalculate the left,top,width and height of each of the controls on your User Control.
As the control is drawn on the client form at design time, this event is entered.

John G

Iouri
July 10th, 2001, 07:03 AM
This code should resize the grid to show all rows and columns. Though dependent on the number of rows/cols
and their sizes this may mean that part of the grid is off the screen.

Dim dblH As Double
Dim dblW As Double
With MSFlexGrid1
For intRow = 0 To .Rows - 1
dblH = dblH + .RowHeight(intRow) + 22.5
Next
For intCol = 0 To .Cols - 1
dblW = dblW + .ColWidth(intCol) + 45
Next
.Height = dblH - 22.5
.Width = dblW - 45
End With



Iouri Boutchkine
iouri@hotsheet.com