Results 1 to 5 of 5

Thread: MSFlexgrid right click (Resolved)

  1. #1

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    The popupmenu is easy
    VB Code:
    1. Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    2.       If Button = vbRightButton Then
    3.          PopUpMenu mnuMyMenu
    4.      End If
    5. End Sub
    I think you will need to do a left click for the hightlight, and then a right click for the menu.

  3. #3

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    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.

  4. #4
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    VB Code:
    1. Private Sub xgrid_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    2.  
    3. If Button = vbRightButton Then
    4.     xgrid.Row = xgrid.MouseRow  'Sets the selected row to row mouse is over
    5.     xgrid.Col = 0    'set start point for row selection
    6.     xgrid.ColSel = xgrid.Cols - 1 'sets end point for row selection
    7. End If
    8.  
    9. End Sub

    I don't know about the menu part, but it looks like hack is on to something.
    Merry Christmas

  5. #5

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    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
  •  



Click Here to Expand Forum to Full Width