kwrl.net
当前位置:首页 >> 用VB编写程序,在文本框1中输入一段文本,单击"统... >>

用VB编写程序,在文本框1中输入一段文本,单击"统...

Private Sub Command1_Click() Dim sz As Integer, zm As Integer For I = 1 To Len(Text1.Text) Select Case Mid(Text1.Text, I, 1) Case "A" To "Z", "a" To "z" zm = zm + 1 Case "0" To "9" sz = sz + 1 End Select Next I Text2.Text = "字...

Private Sub Command1_Click() For i = 1 To Len(Text1.Text) Select Case Asc(Mid(Text1.Text, i, 1)) Case 65 To 90, 97 To 122: a = a + 1 Case Is < 0: b = b + 1 End Select Next Text2.Text = a Text3.Text = bEnd Sub

private sub form_click() dim i as integer i=i+1 text1.text=val(text1)+1 end sub

假定文本框为Text1,命令按钮为Command1,则: Private Sub Command1_Click() Text1.PasswordChar = "*" End Sub

大小写的情形用ASC码即可进行判断。数字的话,可以用isnumeric()函数进行判断,其他字符的话,其实就是总的字符数减去上述各种情形的和即可。

输入第一个6时 text2是 -6 输入第二个6时 text2是 -6+66=60

dim num as integernum=0for i=0 to 99 if text1(i).text="完成" then num=num+1 end ifnext最终num中就是“完成”的个数

Dim dbl=Double.Parse(textbox1.Text)textbox2.Text=Math.Abs(dbl).ToString()

'给个参考。朋友。窗体上添加:三个文本框,一个命令按钮,一个图片框。 Private Sub Command1_Click() Dim a(3) As Single a(1) = Text1 a(2) = Text2 a(3) = Text3 Picture1.Scale (-5, 20)-(20, -5) Picture1.Line (0, 0)-(20, 0) Picture1.L...

Private Sub Command1_Click()Dim s As String, t As String, p As Strings = Text1.Textt = ""For i = 1 To Len(s) p = Mid(s, i, 1) If Asc(p) > 96 And Asc(p) < 123 Then t = t & Chr(Asc(p) - 32) End If If Asc(p) > 64 And Asc(p) < 91 T...

网站首页 | 网站地图
All rights reserved Powered by www.kwrl.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com