在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:
Dim SW As Boolean
Function func(X As Integer) As Integer
If X<20 Then
Y=X
Else
Y=20+X
End If
func=Y
End Function
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)
SW=False
End Sub
Pdvate Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)
SW=True
End Sub
Private Sub Command1_Click()
Dim intNum As Integer
intNum=InputBox("")
If SW Then
Print func(intNum)
End If
End Sub
程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为
A.输出0
B.输出25
C.输出45
D.无任何输出
第1题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:
Private Sub Commandl_Click( )
Static X As Integer
Static Y As Integer
Cls
Y=1
Y=Y+5
X=5+X
Print X, Y
End Sub
程序运行时,3次单击命令按钮Command1后,窗体上显示的结果为【 】。
第2题:
在窗体上画一个命令按钮,名称为Command1,然后编写如下程序:程序运行后,如果单击命令按钮,则在面体上显示的内容是( )。
第3题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Privme Sub Command1_Click( ) a$="VisualBasic" Print String(3,a$) End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是
A.VVV
B.Vis
C.sic
D.11
第4题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:Private Sub Command1_ Click() Static x As Integer Static y As Integer Cls y=1 y=y+5 x=y +x Print x, yEnd Sub程序运行时,三次单击命令按钮Command1后,窗体上显示的结果为______。
A.15 16
B.15 6
C.15 15
D.5 6
第5题:
在窗体上画一个命令按钮,名称为Command1,然后编写如下程序:
程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。
A.
B.H
C.
D.
第6题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:
Private Sub Command1_Click()
x = -5
If Sgn(x) Then
y = Sgn(x ^ 2)
Else
y = Sgn(x)
End If
Print y
End Sub
程序运行后,单击命令按钮,窗体上显示的是( )。
A.-5
B.25
C.1
D.-1