vb程序设计书习题和参考答案(8)

2019-08-31 19:05

MsgBox \请先选择\ Else

Combo1.AddItem List1.Text

List1.RemoveItem List1.ListIndex End If End Sub

Private Sub Command2_Click() If Combo1.ListIndex = -1 Then MsgBox \请先选择\ Else

List1.AddItem Combo1.Text

Combo1.RemoveItem Combo1.ListIndex End If End Sub

Private Sub Command3_Click() Do While List1.ListCount <> 0 Combo1.AddItem List1.List(0) List1.RemoveItem 0 Loop End Sub

4、 过程设计如下: Private Sub Form_Load() Timer1.Interval = 200

Label1.Caption = \欢迎使用VB\ Label1.Left = -Label1.Width End Sub

Private Sub Timer1_Timer()

If Label1.Left <= Form1.Width Then Label1.Left = Label1.Left + 100 Else

Label1.Left = -Label1.Width End If End Sub

习题七

一、选择题

1、A 2、D 3、A 4、B 5、A 6、D 7、B 8、C 9、C 10、B 11、A 12、C 13、A 14、B 15、B 16、A 17、B 18、C 19、B 20、C 二、程序填空题

1、(1)ScaleWidth (2)Line (x1, 0)-(0, y2) (3)Circle (x1 / 2, y2 / 2), r, vbRed 2、(1)FillStyle = 0 (2)Circle (x, y), r, RGB(255, 0, 0) 三、程序设计题

1、 过程设计如下:

Const pi = 3.14159

Private Sub Command1_Click() Dim i As Single, j As Single

Picture1.Scale (-2 * pi, 1.5)-(2 * pi, -1.5) For i = -2 * pi To 2 * pi Step 0.001 Picture1.PSet (i, 0), vbRed Next i

For j = -2 * pi To 2 * pi Step 0.001 Picture1.PSet (j, Cos(j)), vbBlue Next j End Sub

Private Sub Command2_Click() End End Sub

2、 过程设计如下: Private Sub Form_Click() Dim r As Single r = ScaleWidth

If ScaleWidth > ScaleHeight Then r = ScaleHeight FillStyle = 0

FillColor = RGB(0, 0, 255)

Circle (ScaleLeft + ScaleWidth / 2, ScaleTop + ScaleHeight / 2), r / 2, RGB(0, 0, 255) End Sub

习题八

一、判断题

1、√ 2、× 3、× 4、× 5、√ 6、√ 7、× 8、√ 二、单选题

1、A 2、C 3、A 4、D 5、C 6、B 7、B 8、A 9、D 10、D 11、B 12、D 13、A 三、填空题

1、showOpen showSave ShowPrint ShowColor ShowFont 2、MsgBox 消息框标题 提示文字 消息框的按钮和图标样式 3、菜单编辑器 4、Checked 5、Enabled 6、-

四、程序填空题

(1)Text1.Text + a (2)a = \ (3)Text1.Text = \ (4)Text1.Text = \ (5)a = \ (6)a 五、程序设计题 1、

Private Sub Command1_Click() CommonDialog1.ShowColor

Picture1.FillColor = CommonDialog1.Color

End Sub

Private Sub Command2_Click()

If Picture1.ScaleHeight < Picture1.ScaleWidth Then r = Picture1.ScaleHeight / 2 Else

r = Picture1.ScaleWidth / 2 End If

Picture1.FillStyle = 0

Picture1.Circle (Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2), r End Sub

Private Sub Command3_Click() End End Sub 2、

Private Sub mnumove_Click(Index As Integer) Select Case Index Case 0

Picture1.Top = Picture1.Top - 200 Case 1

Picture1.Top = Picture1.Top + 200 Case 2

Picture1.Left = Picture1.Left - 200 Case 3

Picture1.Left = Picture1.Left + 200 End Select End Sub

习题九

一、选择题

1、D 2、A 3、A 4、C 5、A 6、B 7、A 8、C 二、填空题

1、驱动器列表框 目录列表框 文件列表框 2、Path 3、FileCopy 4、Freefile

5、Open “c:\\a.dat” For Output As #1 三、程序阅读题 1、

NO. 3 2 NO. 4 3 NO. 5 5 NO. 6 8 NO. 7 13

2、

9、C 10、D y= 1 a= 1 y= 3 a= 2 y= 6 a= 3

四、编程题

1、Private Sub Drive1_Change()

Dir1.Path = Drive1.Drive End Sub

Private Sub Dir1_Change() File1.Path = Dir1.Path End Sub

Private Sub Command1_Click()

Open \ For i = 0 To File1.ListCount - 1 Print #1, File1.List(i) Next i Close #1 End Sub

Private Sub Command2_Click() Dim a As String

Open \ While Not EOF(1) Line Input #1, a List1.AddItem a Wend End Sub

2、Private Sub Command1_Click()

If Text1.Text = \

MsgBox \请先输入字符串\ Else

Open \ Print #1, UCase(Text1.Text) Close #1 End If End Sub

习题十

一、选择题

1.D、2.D、3.C、4.D、5.C、6.B、7.C、8.A、9.A、10.C、11.B、12.C、13.D、14.B、15.D 二、程序设计题(略)


vb程序设计书习题和参考答案(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:目录-2018-2023年中国猪鬃行业发展动态分析及市场盈利预测报告(

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: