Private Sub Command1_Click()
If Text1.Text = "" Then Exit Sub
If InStr(Text1.Text, "计算机") <> 0 Then
Label1.Caption = Label1.Caption & Text1.Text & vbCrLf
Else
Label2.Caption = Label2.Caption & Text1.Text & vbCrLf
End If
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub Form_Load()
Text1.Text = ""
Label1.Caption = ""
Label2.Caption = ""
End Sub
你的是vb.60还是啥?这像是vb.net。
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.TextLength > 0 Then
If TextBox1.Text Like "*计算机*" Then
Label1.Text += vbCrLf & TextBox1.Text
Else
Label2.Text += vbCrLf & TextBox1.Text
End If
End If
TextBox1.Focus()
TextBox1.Clear()
End Sub
焦点跳来跳去有个毛病,文本框的当前中文输入状态不能保持,把窗口ImeMode属性设置为On