Solved

MSFlexGrid Question

Posted on 2002-04-29
3
182 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
Comment Utility
Try it without :

     .ColSel = .Cols - 1

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

Expert Comment

by:RAJz
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now