Private Sub Command1_Click()Dim n As Integer, i As Integer, s As Double n = Val(Text1.Text)s = 0For i = 1 To ns = s + i ^ 2Next iText2.Text = sEnd SubPrivate Sub Command1_Click()''' 不得删除本行注释Dim i As IntegerOpen App.Path & "\" & "yssj.txt" For Input As #1For i = 1 To 10Input #1, a(i)Next iClose #1End SubPrivate Sub Command2_Click()''' 不得删除本行注释Dim i As IntegerText1.Text = ""For i = 1 To 10If a(i) Mod 3 = 2 ThenText1.Text = Text1.Text & Str(a(i)) End IfNext iEnd SubPrivate Sub command1_Click()'''不得删除本行注释Dim a As Integer, b As Double, i As Integer, n As Integer n = Val(Text1.Text)a = 0b = 0For i = 1 To na = a + ib = b + aNext iText2.Text = bEnd SubPrivate Sub Command1_Click()'''不得删除本行注释Dim i%, xh$, xm$Open App.Path & "\" & "Xhxm.txt" For Output As #1For i = 1 To 3xh = InputBox("请输入学号")xm = InputBox("请输入姓名")Write #1, xh, xmNext iClose #1End Sub Private Sub Command2_Click()'''不得删除本行注释Dim s as stringOpen App.Path & "\" & "Xhxm.txt" For Input As #2Do While Not EOF(2)Line Input #2, sText1.Text = Text1.Text & s & vbCrLf LoopClose #2End SubPrivate Sub Command1_Click()‘”读取文件”按钮代码'''不得删除本行注释Dim st As StringText1.Text = ""Open App.Path & "\" & “jmwb.txt" For Input As #1While Not EOF(1)Input #1, stText1.Text = Text1.Text + st + vbCrLf WendClose #1End Sub Private Sub Command2_Click()Dim s As String, co As String, c As String, Dim n As Integer, i As Integer, p As Integer s = Trim(Text1.Text)n = Len(s)co = ""For i = 1 To nc = Mid(s, i, 1)p = Asc(c) + 5co = co + Chr(p)Next iText2.Text = coEnd SubPrivate Sub command1_click()'''不得删除本行注释For N = 1 To 15x(N) = Int(Rnd * 91 + 10)Text1.Text = Text1.Text + Str(x(N)) Next NEnd Sub Private Sub Command2_Click()'''不得删除本行注释Dim m As Integer, K As IntegerFor N = 1 To 15For m = N + 1 To 15If x(m) > x(N) ThenK = x(N)x(N) = x(m)x(m) = KEnd IfNext mText2.Text = Text2.Text + Str(x(N)) Next NEnd SubPrivate Sub Command1_Click()Dim char As String * 1char = Trim(Text1.Text)If Not IsNumeric(char) ThenIf (Asc(char) >= 65 And Asc(char) <= 90) Or _(Asc(char) >= 97 And Asc(char) <= 120) ThenLabel1.Caption = "输入的是字母"Else: Label1.Caption = "输入的是其它符号"End IfElse: Label1.Caption = "输入的是数字"End IfEnd SubPrivate Sub Command1_Click()Text1.Text = UCase(Text1.Tag)End SubPrivate Sub Command2_Click()Text1.Text = LCase(Text1.Tag)End SubPrivate Sub Command3_Click()Text1.Text = Text1.TagEnd SubPrivate Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)'对于文本框控件中输入的每次键盘按键弹起事件做一次文本内容保存Text1.Tag = Text1.Text '用Text1.Tag属性作为保存textbox控件文本内容的临时存储区End SubPrivate Sub command1_Click()''' 不得删除本行注释Dim a As Integer, b As Integer, c As Integer Dim max As Integer, min As Integera = Val(Text1.Text)b = Val(Text2.Text)c = Val(Text3.Text)max = a + b + Abs(a - b)max = max / 2min = a + b - Abs(a - b)min = min / 2max = max + c + Abs(max - c)max = max / 2min = min + c - Abs(min - c)min = min / 2Text4.Text = maxText5.Text = minEnd SubPrivate Sub Command1_Click()Dim a As IntegerIf Not IsNumeric(Text1.Text) ThenMsgBox "请输入数字!", 48, "输入的不是数字"Else a = Val(Text1.Text)If (a Mod 4 = 0 And a Mod 100 <> 0) Or a Mod 400 = 0 ThenText2.Text = "闰年"Else: Text2.Text = "非闰年"End IfEnd ifText1.SetFocusText1.SelStart = 0Text1.SelLength = Len(Text1.Text)End SubPrivate Sub Command1_Click()''' 不得删除本行注释Dim n As Integer, i As Integern = Val(Text1.Text)If n < 0 Or (Not IsNumeric(Text1.Text)) Then MsgBox "请输入正整数", 48, "输入的不是正整数" Open App.Path & "\" & "jfwj.txt" For Output As #1For i = 1 To nPrint #1, String(i, "*")Next iClose #1End SubPrivate Sub Command1_Click()''' 不得删除本行注释Dim i As IntegerFor i = 1 To 200If i Mod 3 = 0 And i Mod 7 = 0 ThenText1.Text = Text1.Text + Str(i)End IfNextEnd SubPrivate Sub Command1_Click()''' 不得删除本行注释Dim sum As Single, i As IntegerOpen App.Path & "\" & "Jsdata.txt" For Input As #1 For i = 1 To 15Input #1, Arr(i)Next iClose #1If Op1 ThenT1.Text = AaaEnd IfIf Op2 ThenT1.Text = BbbEnd IfEnd SubPrivate Sub Command1_Click()''' 不得删除本行注释Dim i As Integer, n As Integer, s As Integern = Val(Text1.Text)If n < 0 Or (Not IsNumeric(Text1.Text)) Then MsgBox "请输入正整数", 48, "输入的不是正整数" s = 0For i = 1 To nIf i Mod 3 = 0 Thens = s + iEnd IfNext iText2.Text = sEnd SubPrivate Sub Command1_Click()''' 不得删除本行注释Dim a As Integera = Val(Text1.Text)Text2.Text = zh(a)‘ zh过程在原本的程序代码中已经有了~直接可用End SubPrivate Sub Command1_Click() ''' 不得删除本行注释Dim x As DoubleDim y As Doublex = Val(Text1.Text)If x < 10 Theny = x - 1ElseIf x < 20 Theny = 2 * x - 1Else: y = 3 * x - 1End IfText2.Text = yEnd SubPrivate Sub Command1_Click()''' 不得删除本行注释Text1.Text = ""Open App.Path & "\" & "zfwj.txt" For Input As #1For i = 1 To 10Input #1, a(i)Text1.Text = Text1.Text & " " & a(i)Next iClose #1End Sub Private Sub Command2_Click()''' 不得删除本行注释Dim t As StringText2.Text = ""For i = 1 To 10t = a(i)a(i) = a(10 - i + 1)a(10 - i + 1) = tText2.Text = Text2.Text & " " & a(i) Next iEnd SubPrivate Sub Command1_Click()Dim a As IntegerDim b As Integera = Val(Text1.Text)b = Val(Text2.Text)Label1.Caption = Int(Rnd() * (b - a + 1) + a) Label2.Caption = Int(Rnd() * (b - a + 1) + a) Label3.Caption = Int(Rnd() * (b - a + 1) + a)End SubPrivate Sub Command1_Click()Dim s as stringOpen App.Path & "\" & "Bdata.txt" For Input As #1 Do While Not EOF(1)Line Input #1, sText1.Text = Text1.Text + s + Chr(13) + Chr(10) LoopClose #1End SubPrivate Sub Command1_Click()'''不得删改本行注释Dim n As Integern = Val(Text1.Text)If n < 100 Or n > 999 ThenMsgBox "请输入三位正整数", , "输入出错" Else: Text2.Text = Int(n Mod 10)Text3.Text = Int((n Mod 100) / 10)Text4.Text = Int(n / 100)End IfEnd SubPrivate Sub Command1_Click()'产生按钮的代码i = List1.ListIndexFor i = 0 To 9List1.AddItem Int(90 * Rnd + 10)Next iEnd SubPrivate Sub Command3_Click() ’清除按钮的代码List1.ClearList2.ClearEnd Sub Private Sub Command2_Click()'''不得删改本行注释Dim n As Double, j As Integeri = List1.ListIndexFor i = List1.ListCount - 1 To 0 Step -1 n = Val(List1.List(i))If n Mod 2 = 1 ThenList2.AddItem nList1.RemoveItem iEnd IfNext iEnd SubPrivate Sub Command1_Click()‘”读入数据”按钮代码'''不得删除本行注释Dim st As StringText1.Text = ""Open App.Path & "\" & "yy.txt" For Input As #1While Not EOF(1)Input #1, stText1.Text = Text1.Text + st + vbCrLf WendClose #1End Sub Private Sub Command2_Click()'''不得删除本行注释Dim x As String, y As String * 1, n As Integer, i As Integer, p As Integerx = Trim(Text1.Text)n = Len(x)p = 0For i = 1 To ny = UCase(Mid(x, i, 1))If y >= "A" And y <= "Z" Thenp = p + 1End IfNext iLabel1.Caption = "共" & p & "个字母"End SubPrivate Sub Command1_Click()'''不得删除本行注释Dim n As Integer, k As Integer, i As IntegerFor n = 200 To 300k = Int(Sqr(n))For i = 2 To kIf n Mod i = 0 Then Exit ForNext iIf i > k Then List1.AddItem nNext nEnd Sub。