更多"在窗体上有一个命令按钮Command1,编写如下程序: Privat"的相关试题:
[单项选择]在窗体上有一个命令按钮Command1,编写下列程序:
Private Sub Command1_Click( )
Print pp1(3,7)
End Sub
Public Function pp1(x As Single,n As Integer)As Single
If n=0 Then
pp1=1
Else
If n Mod 2=1 Then
pp1=x*x+n
Else
pp1=x*x-n
End If
End If
End Function
程序运行后,单击该命令按钮,屏幕上显示的是( )。
A. 2
B. 1
C. 0
D. 16
[单项选择]在窗体上有一个命令按钮Command1,编写如下程序: Private Sub Command1_Click( ) Print pp1(3, 7) End Sub Public Function pp1(x As Single, n As Integer) As Single If n = 0 Then pp1= 1 Else If n Mod 2 = 1 Then pp1 =x*x+n Else pp1 =x*x-n End If End If End Function 程序运行后,单击该命令按钮,屏幕上显示的是( )。
A. 2
B. 1
C. 0
D. 16
[单项选择]在窗体上有一个命令按钮Command1,编写事件代码如下。
Private Sub Command1_Click( )
Dim x As Integer,y As Integer
x=12:y=32
Call Proc(x,y)
Debug.Print x;y
End Sub
Public Sub Proc(n As Integer,ByVal m As Integer)
n=n Mod 10
m=m Mod 10
End Sub
打开窗体运行后,单击命令按钮,立即窗口上输出的结果是( )。
A. 2 32
B. 12 3
C. 2 2
D. 12 32
[单项选择]在窗体上有一个命令按钮Command1,编写事件代码如下:
Private Sub Command1_Click( )
Dim d1 As Date
Dim d2 As Date
d1=#12/25/2009#
d2=#1/5/2010#
MsgBox DateDiff("ww",d1,d2)
End Sub
打开窗体运行后,单击命令按钮,消息框中输m的结果是( )。
A. 1
B. 2
C. 10
D. 11
[单项选择]在窗体上有一个命令按钮,然后编写如下事件过程 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 Command1_Click( )
a=InputBox("请输入一个整数")
Text1.Text=a
If a > 0 Then
If a Mod 3 = 0 Then
MsgBox "True"
Else
MsgBox "error"
End If
End If
End Sub
程序运行后,单击命令按钮,在输入对话框里输入12,则弹出的提示内容是______。