单项选择题
单击命令按钮时,下列程序的运行结果为
Private Sub Command1_Click()
Print Fun(23,18)
End Sub
Public Function Fun(m As Integer,n As Integer)As Integer
Do While m<>n
Do While m>n:m=m-n:Loop
Do While m<n:n=n-m:Loop
Loop
Fun=m
End Function
A.0
B.1
C.3
D.5
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
在窗体上画一个名称为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 Private 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.无任何输出
点击查看答案&解析
单项选择题
在窗体上画一个命令按钮Command1和两个文本框,名称分别为Text1和Text2。编写如下两个事件过程: Dim Str1 As String,str2 As String Private Sub form_load() Text1.Text= Text2.Text= Text1.Enabled=False Text2.Enabled=False End Sub Private Sub Form_KeyPress(KeyAscii As Integer) str1=str1&Chr(KeyAscii) End Sub Prirate Sub Form_KeyDown(KeyCode As Integer,Shift As Integer) str2=str2&Chr(KeyCode) End Sub Private Sub Command1_Click() Text1.Text=str1 Text2.Text=str2 str1= str2= End Sub 当在设计阶段的窗体的KeyPreview属性设置为True时,程序运行过程中,在键盘上输入小写字母abc,然后单击命令按钮,则文本框Text1中显示的内容为
A.abc
B.不显示任何信息
C.ABC
D.出错
点击查看答案&解析
相关试题
关闭当前的工程并退出Visual Basic的快捷...
下列程序段的执行结果为 m=2 n=3 Do...
将一个窗体设置为MDI子窗体的方法是
一个关系中属性个数为l时,称此关系为
在窗体上有一个文本框控件,名称为TextTime...