[计算机类试卷]VB机试模拟试卷44及答案与解析.doc

上传人:cleanass300 文档编号:493830 上传时间:2018-11-28 格式:DOC 页数:3 大小:40.50KB
下载 相关 举报
[计算机类试卷]VB机试模拟试卷44及答案与解析.doc_第1页
第1页 / 共3页
[计算机类试卷]VB机试模拟试卷44及答案与解析.doc_第2页
第2页 / 共3页
[计算机类试卷]VB机试模拟试卷44及答案与解析.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、VB机试模拟试卷 44及答案与解析 一、基本操作题( 30分) 1 有一个工程文件 ylc.vbp(相应的窗体文件名为 ylc5.frm),在窗体上画一个名为List1的列表框和一个名为 Text1的文本框。编写窗体的 MouseDown事件。程序运行后,如果用鼠标左键单击窗体,则从键盘上输入要添加到列表框的项目;如果用鼠标右键单击窗体,则从键盘上输入要删除的项目,将其从列表中删除。程序的运行情况如图 23所示。注意:存盘时必须存放在考生文件夹下,工程文件名为ylc5.vbp,窗体文件名为 ylc5.frm。 VB机试模拟试卷 44答案与解析 一、基本操作题( 30分) 1 【正确答案】 1操

2、作步骤 (1)在 Visual Basic集成环境选择 “文件 ”“ 打开工程 ”命令,在对话框中选择ylc5.vbp工程文件,单击 “确定 ”按钮打开。 (2)在工具箱中选择 ListBox控件,在窗体上创建该控件,命名为 List1。在工具箱中选择 TextBox控件,在窗体中创建并命名为 Text1,标题为空。 2行为编码 在代码窗口选择 Form对象的 MouseDown事件,其行为代码如下: Private Sub Form MouseDown(Button As Integer, Shift As Integer, _ X As Single, Y As Single) Selec

3、t Case Button 若按下的是鼠标左键 Case 1 将文本框中的内容加入列表框 List1.Addltem, (Text1.Text) 清空文本框 Text1. Text=“ “ 若按下的是鼠标右键 Case 2 删除列表框中与文本框相同的内容 For i=0 To List1.ListCount-1 If List1.List(i)=Text1.Text Then List1.Removeltem(i) Exit For End If Next i End Select End Sub 3存盘保存 执行 “文件 ”“ 保存工程 ”命令,工程文件名为 ylc5.vbp,窗体文件名为 ylc5.frm。 【试题解析】 (1)本题考查考生对 ListBox控件的属性控制和操作,特别对鼠标按键的控制进行了仔细的考查。 (2)注意使用 ListBox控件的 AddItem、 RemoveItem方法、鼠标消息的控制。 (3)本题是根据键码的值,使用 Select语句来判断按下的是鼠标左键或右键。

展开阅读全文
相关资源
猜你喜欢
  • AECMA PREN 2898-1988 Aerospace Series Corrosion and Heat Resisting Steel Rivets Technical Specification Issue P 1《航空航天系列防腐耐热钢制柳钉技术规范.P1版》.pdf AECMA PREN 2898-1988 Aerospace Series Corrosion and Heat Resisting Steel Rivets Technical Specification Issue P 1《航空航天系列防腐耐热钢制柳钉技术规范.P1版》.pdf
  • AECMA PREN 2899-1997 Aerospace Series Vulcanized Rubbers Tests on the Susceptibility to Corrosion in a Damp Atmosphere of Metals in Contact with Vulcanized Rubbers Edition P 1《航空航天.pdf AECMA PREN 2899-1997 Aerospace Series Vulcanized Rubbers Tests on the Susceptibility to Corrosion in a Damp Atmosphere of Metals in Contact with Vulcanized Rubbers Edition P 1《航空航天.pdf
  • AECMA PREN 2900-1998 Aerospace Series Clamps Technical Specification Issue P 2 [Refer To ASD-STAN PREN 3077 ASD-STAN PREN 3078]《航空航天系列夹子技术规范.P2版》.pdf AECMA PREN 2900-1998 Aerospace Series Clamps Technical Specification Issue P 2 [Refer To ASD-STAN PREN 3077 ASD-STAN PREN 3078]《航空航天系列夹子技术规范.P2版》.pdf
  • AECMA PREN 2901-1998 Aerospace Series Clamps Loop ( Type) with Rubber Cushioning in Corrosion Resisting Steel Dimensions - Masses Issue P 2 [Refer To ASD-STAN PREN 4113]《航空航天系列P类系列.pdf AECMA PREN 2901-1998 Aerospace Series Clamps Loop ( Type) with Rubber Cushioning in Corrosion Resisting Steel Dimensions - Masses Issue P 2 [Refer To ASD-STAN PREN 4113]《航空航天系列P类系列.pdf
  • AECMA PREN 2902-1998 Aerospace Series Clamps Loop ( Type) with Rubber Cushioning in Aluminium Alloy Dimensions - Masses Issue P 1 [Refer To ASD-STAN PREN 4114]《航空航天系列P类系列夹子和环橡胶缓冲器铝.pdf AECMA PREN 2902-1998 Aerospace Series Clamps Loop ( Type) with Rubber Cushioning in Aluminium Alloy Dimensions - Masses Issue P 1 [Refer To ASD-STAN PREN 4114]《航空航天系列P类系列夹子和环橡胶缓冲器铝.pdf
  • AECMA PREN 2903-1998 Aerospace Series Clamps Worm Drive Dimensions - Masses Issue P 2 [Refer To ASD-STAN PREN 4234]《航空航天系列夹子螺纹驱动尺寸--鞍状铝合金尺寸--质量 P 2版》.pdf AECMA PREN 2903-1998 Aerospace Series Clamps Worm Drive Dimensions - Masses Issue P 2 [Refer To ASD-STAN PREN 4234]《航空航天系列夹子螺纹驱动尺寸--鞍状铝合金尺寸--质量 P 2版》.pdf
  • AECMA PREN 2904-1998 Aerospace Series Clamps - Saddle in Aluminium Alloy Dimensions - Masses Issue P 2 [Refer To ASD-STAN PREN 3730]《航空航天系列夹子螺纹驱动尺寸--鞍状铝合金尺寸--质量 P 2版》.pdf AECMA PREN 2904-1998 Aerospace Series Clamps - Saddle in Aluminium Alloy Dimensions - Masses Issue P 2 [Refer To ASD-STAN PREN 3730]《航空航天系列夹子螺纹驱动尺寸--鞍状铝合金尺寸--质量 P 2版》.pdf
  • AECMA PREN 2905-1998 Aerospace Series Rubber Cushionings for Clamps Dimensions - Masses Issue P 2 [Refer To ASD-STAN PREN 4115]《航空航天系列夹子橡胶缓冲器尺寸--质量.P2版》.pdf AECMA PREN 2905-1998 Aerospace Series Rubber Cushionings for Clamps Dimensions - Masses Issue P 2 [Refer To ASD-STAN PREN 4115]《航空航天系列夹子橡胶缓冲器尺寸--质量.P2版》.pdf
  • AECMA PREN 2906-1986 Aerospace Series Nuts Self Locking Bi Hexagonal in Heat Resisting Steel FE-PA92HT (A286) Unplated Classification 1100 MPa 650 Degrees Celsius Issue P 1《航空航天系列自.pdf AECMA PREN 2906-1986 Aerospace Series Nuts Self Locking Bi Hexagonal in Heat Resisting Steel FE-PA92HT (A286) Unplated Classification 1100 MPa 650 Degrees Celsius Issue P 1《航空航天系列自.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1