Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sizing Cols in the MSHFlexGrid 1

Status
Not open for further replies.

leaf

Programmer
Mar 9, 2000
32
0
0
US
Going Crazy!

Does anyone know how to trap the sizing of Cols in a MSHFlexGrid?

I have been working on this for about 3 hours. My brain is about to explode.

Thanks in Advance,

leaf
 
What do you mean by trap the sizing of Cols??

If you mean how do you set the column widths, use:

MSFlexGrid1.ColWidth(0) = 100
MSFlexGrid1.ColWidth(1) = 200
MSFlexGrid1.ColWidth(2) = 300
MSFlexGrid1.ColWidth(3) = 400


Simon
 
If you want to set them you do it during run time.

MSFGrid.ColWidth(0) = 1000
MSFGrid.ColWidth(1) = 2000

If you print it out it won't be exactly what you set it to.
ie. 1000 will be 1005, 2000 is 1995.

MsgBox MSFGrid.ColWidth(0)
MsgBox MSFGrid.ColWidth(2)
 
What I mean is anytime a user resizes a col with the mouse I want to keep track of the width the col was sized too. So if the control had a Col_Resize Event( but it doesn't) I would be able to put some code in that Event, that would store the new col size.



rgds,

Leaf
 
As there isn't an event to handle this, (here comes the workaround) you could have a timer control on the form and check the column sizes when the timer fires.

Simon
 
I thought about using the timer control but for now I going to use the mousemove on the MSHFlexgrid.

Private Sub grdMyRec_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

' If Mouse is on Fixed row then check resize of col
' else just exit sub
If (y > 200) Then
Exit Sub
End If

' Call function that checks the size of cols.
Call CheckColResize
End Sub

I figured there will be times when the program will be process information without any user intervention and I did not want a timer going off every 5 sec.

But thanks for the tip.

rgds,

Leaf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top