正在加载图片...
End Sub D) Private Sub Picturel Drag Drop(Source As Control, X As Single, Y As Single) banana Move banana Left+X ba End sub (33)在窗体上面1个名称为 Commandl的命令按钮,然后编写下列事件过程 Private Sub Command1 Click() Dim a(5, 5)As Integer or i=l To 5 F 1 To 5 a(,j)=(1+j)*50 For i=l To 5 S=S+a(1,1) Print End Sub 程序运行后,单击命令按钮,输出结果是() B) (34)在窗体上从左到右有 TextI、Text2两个文本框,如图所示,要求程序运行时,在 TextI 中输入1个分数后按回车键,则判断分数的合法性,若分数为0~100中的1个数 则光标移到Text2中;否则光标不动,并弹出对话框显示“分数错”。下列程序中正 确的是() A) Private Sub Text1 KeyPress(Key Ascii As Integer) If KeyAscii=13Then“回车符的ASCⅡ码是13 Text2 Setfocus Textl SetFocus: MsgBox("分数错") End If nd If End sub B)Private Sub Textl Key Press(Key Ascii As Integer If KeyAscii=13Then“回车符的ASCI码是13 If a >=0 And a < 100 Then Else 二级 Visual basic语言程序设计试卷第7页(共11页)二级 Visual Basic 语言程序设计试卷 第 7 页(共 11 页) End Sub D)Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single) banana.Move banana.Left + X, banana.Top + Y End Sub (33)在窗体上面 1 个名称为 Command1 的命令按钮,然后编写下列事件过程 Option Base 1 Private Sub Command1_Click( ) Dim a(5, 5)As Integer For i= 1 To 5 For j = 1 To 5 a(i, j) = (i +j )*5\10 Next j Next i s=0 For i=1 To 5 s=s+a(i, i) Next i Print s End Sub 程序运行后,单击命令按钮,输出结果是( )。 A)15 B)13 C)11 D)9 (34)在窗体上从左到右有 Text1、Text2 两个文本框,如图所示,要求程序运行时,在 Text1 中输入 1 个分数后按回车键,则判断分数的合法性,若分数为 0~100 中的 1 个数, 则光标移到 Text2 中;否则光标不动,并弹出对话框显示“分数错”。下列程序中正 确的是( )。 A)Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii= 13 Then '回车符的 ASCII 码是 13 a = Val(Text1) If a >= 0 Or a <= 100 Then Text2.SetFocus Else Text1.SetFocus : MsgBox ("分数错") End If End If End Sub B)Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then '回车符的 ASCII 码是 13 a = Val(Text1) If a >= 0 And a <= 100 Then Text1.SetFocus Else
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有