bobm5
02-09-2005, 08:40 PM
Hi,
I'm using a flexgrid in my VB6 app. I just want to know if it is possible to detect a click for when you click on the resize handles in the fixed columns & rows.
I want to do something similar to excel where when you double click on the resizer and it autosizes the column/row. I've searched all over and can't find anything about this.
Here's what i've tried so far. I hope there's a nice simple way to do this :)
Private Sub Grid_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Col0_1 = Grid.ColPos(0) + Grid.ColWidth(0) ' Between Col 0 & Col 1
If x = Col0_1 Then
MsgBox "Clicked Between Column 0 and 1"
End If
End Sub
The mouseup event fires when the handles are double-clicked but the value of x doesn't seem to be very reliable.
In this calse Col0_1 was 690. When Double-clicking on the handles x becomes 675.
I also used the mousemove event to output the value of x in the status bar.
when i moved over the resize handles it showed 690, but after double-clicking x was still 675 in the mouseup event. Could this be some timing issue?
Thanks
Bob
I'm using a flexgrid in my VB6 app. I just want to know if it is possible to detect a click for when you click on the resize handles in the fixed columns & rows.
I want to do something similar to excel where when you double click on the resizer and it autosizes the column/row. I've searched all over and can't find anything about this.
Here's what i've tried so far. I hope there's a nice simple way to do this :)
Private Sub Grid_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Col0_1 = Grid.ColPos(0) + Grid.ColWidth(0) ' Between Col 0 & Col 1
If x = Col0_1 Then
MsgBox "Clicked Between Column 0 and 1"
End If
End Sub
The mouseup event fires when the handles are double-clicked but the value of x doesn't seem to be very reliable.
In this calse Col0_1 was 690. When Double-clicking on the handles x becomes 675.
I also used the mousemove event to output the value of x in the status bar.
when i moved over the resize handles it showed 690, but after double-clicking x was still 675 in the mouseup event. Could this be some timing issue?
Thanks
Bob