|
-
Mar 11th, 2002, 07:56 AM
#1
Thread Starter
Hyperactive Member
MSFlexgrid right click (Resolved)
I have a MSFlexgrid and want to allow users to right click on a row and get a menu with some options on it.
So how do I :
1. Get a row to become highlighted when it is right clicked
2. Display a menu with some options
Last edited by GlenW; Mar 11th, 2002 at 09:33 AM.
-
Mar 11th, 2002, 08:59 AM
#2
The popupmenu is easy
VB Code:
Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbRightButton Then
PopUpMenu mnuMyMenu
End If
End Sub
I think you will need to do a left click for the hightlight, and then a right click for the menu.
-
Mar 11th, 2002, 09:08 AM
#3
Thread Starter
Hyperactive Member
Thanks Hack, thats something I've never used before.
I'm still trying to get the right click to highlight the row, I'll let you know if I manage it.
-
Mar 11th, 2002, 09:26 AM
#4
Fanatic Member
VB Code:
Private Sub xgrid_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbRightButton Then
xgrid.Row = xgrid.MouseRow 'Sets the selected row to row mouse is over
xgrid.Col = 0 'set start point for row selection
xgrid.ColSel = xgrid.Cols - 1 'sets end point for row selection
End If
End Sub
I don't know about the menu part, but it looks like hack is on to something.
-
Mar 11th, 2002, 09:30 AM
#5
Thread Starter
Hyperactive Member
MSFlexgrid right click [Resolved]
JPicasso, brilliant it works perfectly!!
Thanks a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|