单项选择题
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:
Private Sub Command1_Click()
Static x As Integer
Cls
For i=1 To 2
y=y+x
x=x+2
Next
Print x,y
End Sub
程序运行后,连续三次单击Command1按钮后,窗体上显示的是( )。
A.4 2
B.12 18
C.12 30
D.4 6
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
在窗体上画1个命令按钮,名称为Command1,然后编写如下程序: Dim Flag As Boolean Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox( 请输入: ) If Flag Then Printf(intNum) End If End Sub Function f(x As Integer)As Integer If X<10 Then Y=X Else Y=X+10 End If f=Y End Function Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single) Flag=True End Sub 运行程序,首先单击窗体,然后单击命令按钮,在输入对话框中输入5,则程序的输出结果为( )。
A.0
B.5
C.15
D.无任何输出
点击查看答案
单项选择题
窗体上有名称分别为Text1、Text2的2个文本框,有一个由3个单选按钮构成的控件数组Option1,如图1所示。程序运行后,如果单击某个单选按钮,则执行Text1中的数值与该单选按钮所对应的运算(乘以1、10或100),并将结果显示在Text2中,如图2所示。为了实现上述功能,在程序中的下划线处应填入的内容是( )。 Private Sub Option1_Click(Index As Integer) If Text1.Text<> Then Select Case______ Case 0 Text2.Text=Val(Text1.Text) Case 1 Text2.Text=Val(Text1.Text)*10 Case 2 Text2.Text=Val(Text1.Text)*100 End Select End If End Sub
点击查看答案
相关试题
Time或Times
在窗体上画一个名称为Command1的命令按钮...
True或任何非0数值
x(k)=x(k-1)
VB Programming