CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2016
    Posts
    4

    How to select single row in MSFlexGrid dynamically

    Hello,
    I have grid object and one Int Variable, as per value of that int varible, i have select or highlight that whole row.
    Suppose int = 3 then i have highlight 3 row
    if it have 4 i have highlight or select row 4.

    I have tried following
    Code:
    Private Sub NumericDisplay1_Change()
    MSFlexGrid2.Refresh
    MSFlexGrid2.RowSel = 0
    MSFlexGrid2.RowSel = NumericDisplay1.Value
    
    End Sub
    I am using VB6


    any help, really appreaciated

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: How to select single row in MSFlexGrid dynamically

    It depends on how you want to select it. One way is to set the row and the col then use colsel.

    For example if you have 6 columns and more than 3 rows you could select all of the cells in row 3 using
    Code:
    With MSFlexGrid1
        .Row = 3
        .Col = 0
        .ColSel = 5
    End With
    You could use a var in place of the 3 there to make it work with whatever row


    For more info
    https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
    Always use [code][/code] tags when posting code.

Tags for this Thread

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

Featured