《VISUAL BASIC程序设计基础》习题参考-答案.pdf
文本预览下载声明
《Visual Basic程序设计基础》
习题参考答案
第1章 Visual Basic 6.0程序设计概述
一、判断题
1.√ 2.√
3.× 说明:同类控件 (如两个标签)相互重叠,设计时可以设置 “置前”、“置后”属性。
4.√ 5.× 6.√ 7.× 8.√ 9.√ 10.× 11.√ 12.√
13.× 14.√ 15.× 16.√ 17.√ 18.√ 19.√ 20.√
二、选择题
1.C 2.B 3.D 4.C 5.B 6.A 7.D 8.A 9.B 10.A 11.C 12.D
三、填空题
1.对象、事件 2.属性、方法、事件 3.控件、屏幕 (Screen)
4.对象 5.Left、Top 6.属性、对象名.属性名 表达式
7.网格 8.Form1
9.Load 或Initialize 或Resize 或Activate (自动执行的先后顺序也按此排列)
10.Activate、Deactivate
四、程序设计题
程序 1.界面设计参看图10-1、10-2 以及表 10-1。
表10-1 实例2各控件的主要属性设置
控件 属性 (属性值) 属性 (属性值)
标签控件 1 Name(Label1) Caption(我的第一个VB程序)
Name(Label2) Caption(请输入你的姓名)
标签控件2
FontUnderLine(True) FontItalic(True)
命令按钮 1 Name(Command1) Caption(确定(O))
命令按钮2 Name(Command2) Caption(结束(X))
过程设计如下:
Private sub Form_Click ()
Command2.Enabled False
Een Sub
Private Sub Command1_Click ()
Label2.Visible False
Label1.Caption Text1.Text + : 欢迎使用 + Label1.Caption
Text1.Visible False
Command1.Enabled False: Command2.Enabled True
End Sub
Private Sub Command2_Click ()
End
End Sub
程序2.界面设计略,过程设计如下:
Private Sub Command1_Click () 字体变大
Form1.FontSize Form1.FontSize + 3
Form1.Cls: Print 欢迎使用VB
End Sub
Private Sub Command2_Click () 字体变小
Form1.FontSize Form1.FontSize - 3
Form1.Cls: Print 欢迎使用VB
End Sub
Private Sub Command3_Click () 字体加粗
Form1.FontBold True
Form1.Cls: Print 欢迎使用VB
End Sub
Private Sub Command4_Click () 字体不加粗
Form1.FontBold False
Form1.Cls: Print 欢迎使用VB
End Sub
运行时,不得连续、过多次单击 “字体变小”按钮,因为当Font
显示全部