[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Use right mouse click to select the row in MSFlexGrid

Posted on 2004-07-31
6
Medium Priority
?
2,016 Views
Last Modified: 2013-12-25
hi,

I'm using MSFlexGrid, how i can let use the right mouse click to select row in the MSFlexGrid ..
in other words let the right mouse be like the left mouse in the MSFlexGrid..

i want to select row by right click because i'm using popup menu so when i click the right mouse it select row then popup the menu..

Best Regards,
0
Comment
Question by:naamnih
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 11690958
..something like this?

Form1:
-----------
Private Sub Form_Load()
    With MSFlexGrid1
        .Rows = 4
        .Cols = 4
        .TextMatrix(1, 1) = "Test1"
        .TextMatrix(2, 1) = "Test1"
        .TextMatrix(3, 1) = "Test2"
    End With
End Sub
Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = vbRightButton Then
        With MSFlexGrid1
            .Row = .MouseRow
            .Col = .MouseCol
        End With
    End If
End Sub
0
 

Author Comment

by:naamnih
ID: 11691623
thanks zzzzzooc, but your code will not HighLight the row, i mean that i want when i click on the right mouse to highlight (the blue color that appers when we click on the left click) the row..
0
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 11691731
Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = vbRightButton Then
        With MSFlexGrid1
            .RowSel = .MouseRow
            .ColSel = .MouseCol
        End With
    End If
End Sub
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:naamnih
ID: 11692188
Man, your code has a problem.. first i want to select one row not more.
in your example.. run your project then click right click on the second row and then right click on the third row .. the second row will still selected and it will select 2 rows !! the second and the third !!
0
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 500 total points
ID: 11692310
Left-click selection involves multi-selection so I figured you wanted it like that. If you only want to hilight the current selection, you'll have to remove the "focus" rect.


Form1:
-----------
Private Sub Form_Load()
    With MSFlexGrid1
        .FocusRect = flexFocusNone
        .Rows = 4
        .Cols = 4
        .TextMatrix(1, 1) = "Test1"
        .TextMatrix(2, 1) = "Test1"
        .TextMatrix(3, 1) = "Test2"
    End With
End Sub
Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = vbRightButton Then
        With MSFlexGrid1
            .Row = .MouseRow
            .Col = .MouseCol
            .RowSel = .MouseRow
            .ColSel = .MouseCol
            .HighLight = flexHighlightAlways
        End With
    End If
End Sub
0
 

Author Comment

by:naamnih
ID: 11696711
thanks, that what i want :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question