东大19春学期《可视化程序设计Ⅰ》在线作业3辅导答案

上传人:279****70 文档编号:87163817 上传时间:2019-03-28 格式:DOC 页数:5 大小:34.50KB
返回 下载 相关 举报
东大19春学期《可视化程序设计Ⅰ》在线作业3辅导答案_第1页
第1页 / 共5页
亲,该文档总共5页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《东大19春学期《可视化程序设计Ⅰ》在线作业3辅导答案》由会员分享,可在线阅读,更多相关《东大19春学期《可视化程序设计Ⅰ》在线作业3辅导答案(5页珍藏版)》请在金锄头文库上搜索。

1、东大19春学期可视化程序设计在线作业3 一、单选题共20题,100分1、在窗体上画一个名称为CommonDialog1的通用对话框,一个名称为Command1的命令按钮。要求单击命令按钮时,打开一个保存文件的通用对话框。该窗口的标题为“Save”,缺省文件名为“Savefile”,在“文件类型”栏中显示*.txt。则能够满足上述要求的程序是APrivate Sub Command1_Click()CommonDialog1.FileName=SaveFileCommonDialog1.Filter=All Files|*.*|(*.txt)|*.txt|(*.doc)|*.docCommonD

2、ialog1.FilterIndex=2CommonDialog1.DialogTitle=SaveCommonDialog1.Action=2End SubBPrivate Sub Command1_Click()CommonDialog1.FileName=SaveFileCommonDialog1.Filter=All Files|*.*|(*.txt)|*.txt|(*.doc)|*.docCommonDialog1.FilterIndex=1CommonDialog1.DialogTitle=SaveCommonDialog1.Action=2End SubCPrivate Sub

3、Command1_Click()CommonDialog1.FileName=SaveCommonDialog1.Filter=All Files|*.*|(*.txt)|*.txt|(*.doc)|*.docCommonDialog1.FilterIndex=2CommonDialog1.DialogTitle=SaveFileCommonDialog1.Action=2End SubDPrivate Sub Command1_Click()CommonDialog1.FileName=SaveFileCommonDialog1.Filter=All Files|*.*|(*.txt)|*.

4、txt|(*.doc)|*.docCommonDialog1.FilterIndex=1CommonDialog1.DialogTitle=SaveCommonDialog1.Action=1End Sub【东北大学】本题选择:A2、确定一个控件在窗体上的位置的属性是AWidth和HeightBWidth或HeightCTop和LeftDTop或Left【东北大学】本题选择:C3、在窗体上面一个命令按钮(其Name属性为Commandl),然后编写如下代码:Option Base 1Private Sub Commandl_Click( )Dim a(4,4)For i =1 To 4For

5、j =1 To 4a(i,j) = (i-1)*3+jNext jNext iFor i =3 To 4For j =3 To 4Print a(j,i);Next jPrintNext iEnd Sub程序运行后,单击命令按钮,其输出结果为A6 9 7 10B7 10 8 11C8 11 9 12D9 12 10 13【东北大学】本题选择:D4、在窗体上画一个文本框、一个标签和一个命令按钮,其名称分别为Text1、Label1和Command1,然后编写如下两个事件过程:Private Sub Command1_Click() strText = InputBox(请输入) Text1.Te

6、xt = strTextEnd Sub Private Sub Text1_Change() Label1.Caption = Right(Trim(Text1.Text), 3)End Sub程序运行后,单击命令按钮,如果在输入对话框中A空BabcdefCabcDdef【东北大学】本题选择:D5、在窗体上面画一个命令按钮,然后编写如下事件过程:Option Base 1Private Sub Commandl_Click()Dim aa = Array(1,2,3,4)j = 1For i = 4 To Step -1s = s + a(i)*jj =j*10Next iPrint sEnd

7、 Sub运行上面的程序,单击命令按钮,其输出结果是A4321B12C34D1234【东北大学】本题选择:D6、要从磁盘上读入一个文件名为“c:filel.txt”的顺序文件,下面程序段正确的是()AF=c:filel.txtOpen F For Input As # 2BOpen c:filel.txt For Output As # 2COpen c:filel.txt For Input As # 1DOpen c:filel.txt For Input As # 1【东北大学】本题选择:A7、在用通用对话框控件建立“打开”或“保存”文件对话框时,如果需要指定文件列表框所列出的文件类型是文

8、本文件(即.txt文件),则正确的描述格式是A“text (.txt)|(*.txt)”B“文本文件( .txt) | (.txt)”C“text(.txt)|(*.txt)”D“text(.txt)(*.txt)”【东北大学】本题选择:A8、列表框控件中的列表内容是通过( )属性设置的ANameBCaptionCListDText【东北大学】本题选择:C9、为了在按下回车键时执行某个命令按钮的事件过程,需要把该命令按钮的一个属性设置为True,这个属性是AValueBDefaultCCancelDEnabled【东北大学】本题选择:B10、在窗体中添加一个通用对话框,其名称为CommonDi

9、alog1,然后添加一个命令按钮。要求单击命令按钮时,打开一个打开文件的通用对话框。该窗口的标题为“打开”,在文件类型框中显示的是TextFiles(*.txt)。则能够满足上述要求的程序是( )APrivate Sub Command1_Click()CommonDialog1.Flags = cdlOFNHideReadOnlyCommonDialog1.Filter = allfiles(*.*)|*.*|textfiles & (*.txt)|*.txt|Batchfiles(*.bat)|*.batCommonDialog1.FilterIndex = 1CommonDialog1.

10、ShowOpenMsgBox CommonDialog1.FileNameEnd SubBPrivate Sub Command1_Click()CommonDialog1.Flags = cdlOFNHideReadOnlyCommonDialog1.Filter = allfiles(*.*)|*.*|textfiles & (*.txt)|*.txt|Batchfiles(*.bat)|*.batCommonDialog1.FilterIndex = 2CommonDialog1.ShowOpenMsgBox CommonDialog1.FileNameEnd SubCPrivate S

11、ub Command1_Click()CommonDialog1.Flags = cdlOFNHideReadOnlyCommonDialog1.Filter = allfiles(*.*)|*.*|textfiles & (*.txt)|*.txt|Batchfiles(*.bat)|*.batCommonDialog1.FilterIndex =1CommonDialog1.ShowSaveMsgBox CommonDialog1.FileNameEnd SubDPrivate Sub Command1_Click()CommonDialog1.Flags = cdlOFNHideRead

12、OnlyCommonDialog1.Filter = allfiles(*.*)|*.*|textfiles & (*.txt)|*.txt|Batchfiles(*.bat)|*.batCommonDialog1.FilterIndex = 2CommonDialog1.ShowSaveMsgBox CommonDialog1.FileNameEnd Sub【东北大学】本题选择:B11、假定窗体上有一个文本框,名为Txt1,为了使该文本框的内容能够换行,并且具有水平的垂直滚动条,正确的属性设置为( )ATxt1.MultiLine = True : Txt1.ScrollBars = 0BT

13、xt1.MultiLine = True : Txt1.ScrollBars = 3CTxt1.MultiLine = False: Txt1.ScrollBars = 0DTxt1.MultiLine = False Txt1.ScrollBars = 3【东北大学】本题选择:B12、删除ListBox对象list1最后一个列表项的可行语句Alist1.removeitem list1.listcountBlist1.removeitem list1.listcount -1Clist1.deleteitem list1.listcount -1Dlist1.deleteitem list1

14、.listcount【东北大学】本题选择:B13、可以惟一标识控件数组中的每一个控件属性的是ANameBCaptionCIndexDEnabled【东北大学】本题选择:C14、定时器的Interval属性以( )为单位指定Timer事件之间的时间间隔A分B秒C毫秒D微秒【东北大学】本题选择:C15、设在窗体上有一个名称为Command1的命令按钮,并有以下事件过程Private Sub Command1_Click()Static b As Variantb=Array(1,3,5,7,9)End Sub此过程的功能是把数组b中的5个数逆序存放(即排列为9,7,5,3,1)。为实现此功能,省略

15、号处的程序段应该是AFor i=0 to 5-12tmp=b(i)b(i)=b(5-i-1)b(5-i-1)=tmpNextBFor i=0 to 5tmp=b(i)b(i)=b(5-i-1)b(5-i-1)=tmpNextCFor i=0 to 52tmp=b(i)b(i)=b(5-i-1)b(5-i-1)=tmpNextDFor i=0 to 52tmp=b(i)b(i)=b(5-i-1)b(5-i-1)=tmpNext【东北大学】本题选择:C16、(6)在窗体上有若干控件,其中有一个名称为Text1的文本框。影响Text1的Tab顺序的属性是ATabStopBEnabledCVisibleDTabIndex【东北大学】本题选择:D17、刚建立一个新的标准EXE工程后,不在工具箱中出现的控件是A单选按钮B图片框C通用对话框D文本框【东北大学】本题选择:C18、

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 资格认证/考试 > 成考

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号