Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a highlighted row in a flex grid to a list box

Status
Not open for further replies.

jKin

Programmer
Mar 19, 2009
3
0
0
CA
Hi,

How do I add the highlighted row in a flex grid to a list box?

I have a MSFlexgrid with 9 columns. I would like to have the user select a row and put that row of information into a list box.

Thanks for any help provided!!!
 

How about....
Code:
Option Explicit
Dim c As Integer
Dim r As Integer

Private Sub Form_Load()

With MSFlexGrid1
    .Cols = 8
    .Rows = 10
    For c = 0 To .Cols - 1
        For r = 1 To .Rows - 1
            .TextMatrix(r, c) = r & " - " & c
        Next r
    Next c
End With

End Sub

Private Sub MSFlexGrid1_Click()

List1.Clear

With MSFlexGrid1
    .Row = .MouseRow
    For c = 1 To .Cols - 1
        .Col = c
        List1.AddItem .Text
    Next c
End With

End Sub
With MSFlexGrid1 and List1 on the Form

Have fun.

---- Andy
 
Thanks very much for the code!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top