吼吼 不太会这样的 学习学习 如果一个窗体里只有一个text的话想得到你的要求如下 code: Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 9 Then Text1.Text = Text1.Text & vbTab End If End Sub
For Each obj In Me.Controls obj.TabStop = False Next
End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = Asc(vbTab) Then Text1.SelText = vbTab End If End SubPrivate Sub Text1_LostFocus() Dim obj As Control
For Each obj In Me.Controls obj.TabStop = True Next
End Sub
If KeyAscii = 9 Then Text1.Text = Text1.Text & vbTab End If
不太会这样的
学习学习
如果一个窗体里只有一个text的话想得到你的要求如下
code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 9 Then
Text1.Text = Text1.Text & vbTab
End If
End Sub
在Text1_LostFocus事件中試試
Dim obj As Control
For Each obj In Me.Controls
obj.TabStop = False
Next
End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = Asc(vbTab) Then
Text1.SelText = vbTab
End If
End SubPrivate Sub Text1_LostFocus()
Dim obj As Control
For Each obj In Me.Controls
obj.TabStop = True
Next
End Sub
Text1.Text = Text1.Text & vbTab
End If