这是以前写的个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
'************************************
'* 名称: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