紧急求助:vb编程实现如下效果,请给出代码
来源:百度知道 编辑:UC知道 时间:2024/05/07 12:34:07
文本框1中输入若干字符在标签同步显示,输入完单击命令按钮并显示,在文本框2和3中,分别显示输入字符所含3和7的字数。
我来。
Private Sub Command1_Click()
Text2 = Len(Text1.Text) - Len(Replace(Text1.Text, "3", ""))
Text3 = Len(Text1.Text) - Len(Replace(Text1.Text, "7", ""))
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Label1.Caption = Text1.Text
End Sub
程序里需要1个lable,3个textbox,1个command
是这个意思吗?
如果Text1里需要接受粘贴的数据的话把Text1_KeyDown函数换成
Private Sub Text1_Change()
Label1.Caption = Text1.Text
End Sub
如果要程序代码的话。留邮箱。我发你。
Private Sub Command1_Click()
dim str as string
str = Text1.Text
Text2 = Len(Text1.Text) - Len(Replace(Text1.Text, "3", ""))
Text3 = Len(Text1.Text) - Len(Replace(Text1.Text, "7", ""))
Text1.Text =str
End Sub
Private Sub Text1_Change()
Label1.Caption = Text1.Text
End Sub
为什么我什么都不知道
一楼的回答很完美。
Private Sub Comma