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

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

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

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

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

'给个参考。朋友。窗体上添加:三个文本框,一个命令按钮,一个图片框。 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...

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

0和9要加上双引号 If b >= "0" And b

Private Sub Command1_Click() Dim i%, t% Dim s As String Dim n(9) As Integer s = Text1 For i = 1 To Len(s) t = Val(Mid(s, i, 1)) n(t) = n(t) + 1 Next For i = 0 To 9 Print i & "有" & n(i) & "个" Next End Sub Private Sub Text1_Key...

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