问题如下:
        在MSHFlexGrid控件上显示有四列内容,要让第一列和第四列的单元格绑定text;2,3列绑定combox;当鼠标点击该单元格时就会出现自己绑定的控件。多谢各位大侠赐教。

解决方案 »

  1.   

    这是以前写的个text,你问的和这个类似自己看看改改吧,combox也一样就是看你选择的那一列,显示不同的控件
    '************************************
    '*   名称:msgCondition_MouseDown
    '*   功能:
    '*   作者: zhzhufeng
    '*   参数:无
    '*   描述:
    '************************************
    Private Sub msgCondition_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Dim i, j, Index As Integer
        With msgCondition
            txtInput.Visible = False
            If Button = 1 Then
                If .col = 1 Then
    '               txtInput.Visible = False
                    txtInput.Width = .CellWidth
                    txtInput.Left = .Left + .CellLeft
                    txtInput.Top = .Top + .CellTop
                    txtInput.Height = .CellHeight
                    txtInput.Text = .Text
                    txtInput.SelStart = 0
                    txtInput.SelLength = Len(txtInput.Text)
                    txtInput.Visible = True
                    txtInput.ZOrder
                    txtInput.SetFocus
                    .ZOrder 1
                End If
            End If
        End With
    End Sub