Private Sub Command1_Click() If StrConv(Text1.Text, vbNarrow) = Text1.Text Then MsgBox "半角字符" Else MsgBox "全角字符" End If End SubPrivate Sub Form_Load() 'Text1 = "汉字" Text1 = StrConv("HANZI", vbWide) End Sub
Private Sub Command1_Click() If StrConv(Text1.Text, vbNarrow) = Text1.Text Then MsgBox "汉字、英文或数字" Else MsgBox "全角字符" End If End Sub
If StrConv(Text1.Text, vbNarrow) = Text1.Text Then
MsgBox "半角字符"
Else
MsgBox "全角字符"
End If
End SubPrivate Sub Form_Load()
'Text1 = "汉字"
Text1 = StrConv("HANZI", vbWide)
End Sub
If StrConv(Text1.Text, vbNarrow) = Text1.Text Then
MsgBox "汉字、英文或数字"
Else
MsgBox "全角字符"
End If
End Sub