CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2001
    Location
    Rhode Island
    Posts
    56

    Flexgrid double-click

    I am using a flexgrid countrol with one fixed row (row 0) and three fixed columns (col 0,1,2). I would like to take one action when a user double-clicks on a column header or another action when a user double-clicks on a row header. I am using the following code:


    private Sub grd_DblClick()
    If grd.Row = 0 then
    If grd.TextMatrix(grd.Row, grd.Col) <> "" then
    action 1 (grd.textMatrix(grd.Row, grd.Col))
    End If
    else
    If grd.col = 0 then
    action 2 (grd.textMatrix(grd.Row, grd.Col))
    End If
    End If
    End Sub




    However, when selecting a row header (actually column 0), the col value is 3... and when selecting a column header (actually row 0), the row value = 1. Does anyone know why this is? Is there any way to resolve this?

    Thanks,
    Ron


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Flexgrid double-click

    I never noticed that before. Now I tried your sampple and was amazed by this behavior.

    I found a solution. Use grd.MouseRow instead grd.Row

    ....
    If grd.TextMatrix(grd.MouseRow, grd.MouseCol) <> "" then


    Here is the code I tried

    Private Sub grd_DblClick()
    Dim iCol As Integer
    Dim iRow As Integer

    With grd
    MsgBox .MouseRow & "-" & .MouseCol
    End With


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Mar 2001
    Location
    Rhode Island
    Posts
    56

    Re: Flexgrid double-click

    Anyone? Would love some help with this. Thanks.


  4. #4
    Join Date
    Mar 2001
    Location
    Rhode Island
    Posts
    56

    Re: Flexgrid double-click

    Perfect!! Thanks a lot. I appreciate your response!


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