用VB设计一个程序,把一个文本放到一个文本框中,提取出文本中的英文字母,放入第二个文本框,其余的都
Private Sub Command1_Click()
Text2.Text = ""
Text3.Text = ""
If Text1.Text = "" Then
MsgBox "请输入需要分离的内容!!!", 64, "提示 By:风莲素还真"
Text1.SetFocus
Else
Dim i, ch
For i = 1 To Len(Text1.Text) '未去空格长度
ch = Mid((Text1.Text), i, 1)
ac = Asc(ch)
If (ac >= 65 And ac <= 90) Or (ac >= 97 And ac <= 122) Then
Text2.Text = Text2.Text + ch '未去空格结果
'Text2.Text = Text2.Text + (Replace(ch, " ", "")) '去空格结果
Else
Text3.Text = Text3.Text + ch '未去空格结果
'Text3.Text = Text3.Text + (Replace(ch, " ", "")) '去空格结果
End If
Next
End If
End Sub
Private Sub Form_Load()
With Text1
.Text = ""
.ForeColor = vbRed
.FontSize = 12
End With
With Text2
.Text = ""
.ForeColor = vbRed
.FontSize = 12
End With
With Text3
.Text = ""
.ForeColor = vbRed
.FontSize = 12
End With
End Sub