在窗体上添加label1,text1,text2,三个控件
复制下面代码:
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Label1.Caption = "共输入了" & Len(Text2.Text) & "个字符"
End Sub
Private Sub Text1_Change()
Text2.Text = Right(Text1.Text, 1) & Text2.Text
Label1.Caption = "共输入了" & Len(Text2.Text) & "个字符"
End Sub