单击mshFlexGrid时得到所单击的是表头??

解决方案 »

  1.   

    Option ExplicitPrivate Sub Form_Load()
        Dim i As Integer
        Dim j As Integer
        For i = 0 To 5
            For j = 0 To 4
                Me.MSHFlexGrid1.TextMatrix(i, j) = j + 1
            Next
        Next
    End SubPrivate Sub MSHFlexGrid1_Click()
        Dim x As Integer
        Dim y As Integer
        Dim t As String
        x = Me.MSHFlexGrid1.Row
        y = Me.MSHFlexGrid1.Col
        t = Me.MSHFlexGrid1.TextMatrix(x, y)
        Debug.Print t
    End Sub指定一下就不会只是表头了^_^
      

  2.   

    但的mshFlexGrid的selectionmode=1'by row,
    在单击mshFlexGrid时
    我怎样知道单击的是表头,和所单击是第几列
      

  3.   

    那想知道是表头是不是可以判断一下
    如果是行的话,那(0,x),这样的话一定会是行表头
    如果是列的话,那(x,0),这样的话应该会是列表头所单击的列就可以用x=mshflexgrid1.col;y=mshflexgrid1.row来固定了吧^_^
      

  4.   

    If m_MSHFlexGrid1.RowSel = m_MSHFlexGrid1.Rows - 1 _     '选择的行数是总行数
           And m_MSHFlexGrid1.Row = 1 Then                       '当前选择第一行
            i = m_MSHFlexGrid1.Col                               '获得当前列
        End If