Solved

MSFlexGrid Question

Posted on 2002-04-29
3
184 Views
Last Modified: 2010-05-02
How do you programmaticly highlight an entire selected row in a MSFlexGrid Control. I have this code but it only highlights the second column in the row, and i need the whole row selected.

Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    With MSFlexGrid1
        .ColSel = .Cols - 1
        .RowSel = .MouseRow
    End With
End Sub
0
Comment
Question by:Maxim10553
3 Comments
 
LVL 1

Expert Comment

by:cnealy
ID: 6977799
Try it without :

     .ColSel = .Cols - 1

That may be why you are only selecting one column.
0
 

Expert Comment

by:RAJz
ID: 6978298
use this code

Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then
  With MSFlexGrid1
    If .ColSel = .Cols - 1 And .Row = .MouseRow Then
        MsgBox "ok"
    Else
        MsgBox "no"
    End If
  End With
End If
 
End Sub


RAJz
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 50 total points
ID: 6978302
Try:
Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
   With MSFlexGrid1
       .Col= 0
       .Row = .MouseRow
       .ColSel = .Cols - 1
       .RowSel = .MouseRow
   End With
End Sub
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

809 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