更多"窗体上命令按钮Command1的事件过程如下: Private Su"的相关试题:
[单项选择]单击窗体上Command1命令按钮时,执行如下事件过程: Private Sub Command1_Click( ) a$= "software and hardware" b$= Right(a$, 8) c$= Mtd(b$ 1, 8) Msgbox c$ End sub则在弹出的信息框的标题栏中显示的信息是( )。
A. software and hardware
B. software
C. hardware
D. and
[填空题]单击窗体上的命令按钮Command1, 【10】
Private Sub Command1_Click( )
a= "10"
b=20
c=Val(a) +b
Print c
End Sub
[填空题]在窗体上添加一个命令按钮Command1,然后编写如下事件过程。
Private Sub Command1_Click( )
Dim b,k
For k=1 To 6
b=23+k
Next k
MsgBox k+b
End Sub
打开窗体后,单击命令按钮,消息框数据的结果是______。
[单项选择]在窗体上有一个命令按钮Command1,通用过程fun和命令按钮的事件过程如下:
Private Function fun(ByVal m As Integer)
If m Mod 2=0 Then
fun=2
Else
fun=1
End If
End Function
Private Sub Command1_Click( )
Dim i As Integer,s As Integer
s=0
For i=1 To 5
s=s+fun(i)
Next
Print s
End Sub
程序运行后,单击命令按钮,则窗体上输出( )。
A. 6
B. 7
C. 8
D. 9
[单项选择]在窗体上有一个命令按钮,然后编写如下事件过程 Private Sub Command1 _ cickc ( ) a=InputBox("enter the first integer") b=InputBox("enter the second integer") Print b + a End Sub 程序运行后,单击命令按钮,先后在两个输入框中分别输入“2”和“6”,则输出结果为
A. 2
B. 62
C. 8
D. 26
[单项选择]在窗体上有一个命令按钮,然后编写如下事件过程:
Private Sub Command1Click( )
Dim a(5)As String
For i=1,To 5
a(i)=Chr(Asc("A")+(i-1))
Next i
For Each b In a
Print b;
Next
End Sub
程序运行后,单击命令按钮,输出结果是( )。
A. ABCDE
B. 1 2 3 4 5
C. abcde
D. 出错信息
[填空题]在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command1 Click( )
Do Until b<O
a=InputBox("输入a的值")
a=Val(A)
b=InputBox("输入b的值")
b=Val(B)
a=a+b
Loop
Print a
End Sub
程序运行后,依次输入5,4,3,2,1,0,-1,-2,则输出结果是 【12】 。
[填空题]在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command1 Click( )
a= Val(InputBox(“请输入一个整数”))
b=Val(InputBox(“请输入一个整数”))
Print a+b
End Sub
程序运行后,单击命令按钮,在输入对话框中分别输入12和34,输出结果为 ______。
[单项选择]在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
Dim I,Num
Randomize
Do
ForI=1 To 1000
Num=Int(Rnd*100)
Print Num;
SelectCase Num
Case 12
Exit For
Case 58
Exit Do
Case 65,68,92
End
End Select
Next I
Loop
End Sub
上述事件过程执行后,下列描述中正确的是
A. Do循环执行的次数为1000次
B. 在For循环中产生的随机数小于或等于100
C. 当所产生的随机数为12时结束所有循环
D. 当所产生的随机数为65、68或92时窗体关闭、程序结束
[填空题]单击窗体上的命令按钮Command1,______
Private Sub Command1_Click( )
a= "10"
b=20
c=Val(a) +b
Print c
End Sub