有如下Sub过程: Sub Sun(x As Single, y As Single) t=x x=t/y y=t Mod y End Sub 在窗体上的命令按钮Command1中,编写如下事件过程,执行该事件过程调用Sun过程,结果为( )。 Private Sub Command1_Click() Dim a As Single Dim b As Single a=5 b=4 Sun a, b Print a; b End Sub
A.1.25 1
B.5 4
C.4 5
D.1 1.25
第1题:
(12)有下列Sub过程: Sub Sub(x As Single,y As Single) t=x x=t/y y=t Mody End Sub 在窗体上的命令按钮Commandl中,编写下列事件过程,执行该事件过程调用Sun过程,结果是( )。 Private Sub Commandl_Click() Dim a As Single Dim b As Single a=5 b=4 Sun a,b Print a;b End Sub A.1.25 1 B.5 4 C.4 5 D.1 1.25
第2题:
假定有如下的Sub过程: Sub sfun(x As Single,y As Single) t=x x=t/y y=t Mod y End Sub 在窗体上添加一个命令按钮(名为Command1),然后编写如下事件过程: Private Sub Command1 Click() Dim a as single Dim b as single a=5 b=4 sfun a,b MsgBox a & chr(10)+chr(13)&b End Sub 打开窗体运行后,单击命令按钮,消息框的两行输出内容分别为( )。
A.1n1
B.1.25和1
C.1.25和4
D.5和4
第3题:
假定有如下的Sub过程:
Sub sfun(x As Single,y As Single)
t=x
x=t/y
y=t Mod y
End Sub
在窗体上添加一个命令按钮(名为Command1),然后编写如下事件过程:
Private Sub Command1_Click()
Dim a as single
Dim b as single
a=5
b=4
sfun a,b
MsgBox a & chr(10)+chr(13)& b
End Sub
打开窗体运行后,单击命令按钮,消息框的两行输出内容分别为
A.1和1
B.1.25和1
C.1.25和4
D.5和4
第4题:
有如下程序: Private Sub Commandl_Click() Dim a As Single Dim b As Single a=2:b=4 Call CS(a,b)End Sub Sub CS(x As Single,y As Single) t=X x=t\y y=t Mod y End Sub 程序运行后,单击命令按钮,a和b的值分别为
A.0 0
B.1 1
C.0 2
D.1 2
第5题:
有如下程序: Private Sub Command1_Click() Dim a As Single Dim b As Single a=5:b=4 Call Sub1(a,b) End Sub Sub Sub1(x As Single,y As Single) t=X X=t\Y Y=t Mod y End Sub 在调用运行上述程序后,a和b的值分别为
A.0 0
B. 1 1
C.2 2
D.1 2
第6题:
有如下SUB过程:
Sub s(x As Single,y As Single)
t=x
x=t / y
y=t Mod y
End Sub
在窗体上添加一个命令按钮,然后编写如下事件过程:
Private Sub Form_Click()
Dim a As Single
Dim b As Single
a=5
b=4
s a,b
Print a,b
End Sub
则程序运行后,单击命令按钮,输出的结果为【 】 。
第7题:
下面程序是由鼠标事件在窗体上画图,如果按下鼠标可以画图,双击窗体则可以清除所画图形。补充完整下面的程序。首先在窗体层定义如下变量:
Dim PaintStart As Boolean
编写如下事件过程:
Private Sub Form_Load()
DrawWidth=2
ForeColor=vbGreen
End Sub
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X AS Single,Y AS Single)
PaintStart=True
End Sub
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
If PaintStart Then
PSet(X,Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)
End Sub
Private Sub Form_DblClick()
Cls
End Sub
第8题:
( 25 )要求当鼠标在图片框 P1 中移动时,立即在图片框中显示鼠标的位置坐标。下面能正确实现上述功能的事件过程是
A )
Private Sub P1_MouseMove ( Button AS Integer,Shift As Integer,X As Single,
Y As Single )
Print X,Y
End Sub
B )
Private Sub P1_MouseDown ( Button AS Integer,Shift As Integer,X As Single,
Y As Single )
Picture.Print X,Y
End Sub
C )
Private Sub P1_MouseMove ( Button AS Integer,Shift As Integer,X As Single,
Y As Single )
P1.Print X,Y
E n d S u b
D )
Private Sub Form_MouseMove ( Button AS Integer,Shift As Integer,X As Single,
Y As Single )
P1.Print X,Y
End Sub
第9题:
编写如下通用过程: Sub Proc(x As Single,y As Single) t=x x=t/y y=t Mod y End Sub 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Commandl Click() Dim a As Single Dim b As Single a=5 b=4 Proc a,b Print a,b End Sub 程序运行后,如果单击命令按钮,则输出结果为
A.5 4
B.1.25 1
C.4 5
D.1.25 5
第10题:
假定有如下的Sub过程: Sub Func(x As Single, y As Single) t=x x=t/y y=t Mod y End Sub 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Single Dim b As Single a=6 b=5 Func(a, B) Print a, b End Sub 程序运行后,单击命令按钮,输出结果为 ______。
A.6 5
B.1 1
C.1.2 5
D.1.2 1