VB 语言程序设计课后编程及上机调试参考答案ex0101Private Sub Label1_Click() Caption = "练习" Command1.Caption = "确定" Label1.FontBold = True Label1.AutoSize = True Label1.Caption = "Visual Basic 程序设计教程"End Subex0102Private Sub Command1_Click() Txt.Text = "我有电脑"End SubPrivate Sub Command2_Click() Txt.Text = "我没有电脑"End SubPrivate Sub Command3_Click() Txt.Text = "" '一对双撇号,中间不留空End Subex0104Private Sub Command1_Click() Dim x As Single x = Val(Text1.Text) Text2.Text = 15 * xEnd Subex0202Private Sub Form_Click() Dim r As Single, s As Single r = 4.6 s = 3.14159 * r ^ 2 Text1.Text = "圆的面积为" & sEnd Subex0204Private Sub Command1_Click() '"最大化"按钮 Form1.WindowState = 2 '最大化End SubPrivate Sub Command2_Click() '"还原"按钮 Form1.WindowState = 0 '还原End Sub1Private Sub Command3_Click() '"最小化"按钮 Form1.WindowState = 1 '最小化End Subex0205Private Sub command1_click() Dim x As Single Dim y As Single x = Val(Text1.Text) y = Val(Text2.Text) Text3.Text = x * x + y * yEnd Subex0206Private Sub command1_click() Dim x As String x = Text1.Text Text2.Text = Left(x, 1) + Right(x, 1)End Subex0301Private Sub Form_Load() Dim x As Integer, y As Integer Dim a As Integer, b As Integer, c As Integer x = Val(InputBox("请输入一个三位数")) a = Int(x / 100) '求百位数 b = Int(x / 10) - a * 10 '求十位数 c = x Mod 10 '求个位数 Show y = c * 100 + b * 10 + a '生成倒序数 Print x; "倒序数为:"; y '显示倒序数End Subex0302Private Sub Command1_Click() n = Val(Text1.Text) Randomize x = Int(1 + n * Rnd) Label1.Caption = "第一个随机数" + Str(x) x = Int(1 + n * Rnd) Label2.Caption = "第二个随机数" + Str(x) x = Int(1 + n * Rnd) Label3.Caption = "第三个随机数" + Str(x)End Sub2ex0303Private Sub Cmd1_Click() Lab1.Visible = T...