对象、属性、值
对象、值、属性
对象、方法、属性
属性、对象、值
第1题:
D)窗体(Form)可以作为过程的参数
(25)在窗体上画一个名称为 Command1 的命令按钮,再画两个名称分别为 Label1、Label2 的标签,然后
编写如下程序代码:
Private X As Integer
Private Sub Command1_Click( )
X=5: Y=3
Call proc(X, Y)
Label1.Caption=X
Label2.Caption=Y
End Sub
Private Sub proc(a As Integer, ByVal b As Integer)
X=a*a
Y=b+b
End Sub
程序运行后,单击命令按钮,则两个标签中显示的内容分别是( )。
A)25 和 3
B)5 和 3
C)25 和 6
D)5 和 6
第2题:
A. 对象,值,属性
B. 对象,方法,属性
C. 对象,属性,值
D. 属性,对象,值
第3题:
设一个工程由两个窗体组成,其名称分别为Form1和Form2,在Form1上有一个名称为Command1的命令按钮。窗体Form1的程序代码如下:
Private Sub Command1_Click()
Dim a As Integer
a=10
Call g(Form2,a)
End Sub
Private Sub g(f As Form,x As Integer)
y=IIf(x>10,100,-100)
f,Show
f.Caption=y
End Sub
运行以上程序,正确的结果是( )。
A.Form1的Caption属性值为100
B.Form2的Caption属性值为-100
C.Form1的Caption属性值为-100
D.Form2的Caption属性值为100
第4题:
在窗体上画一个名称为Command1的命令按钮,再画两个名称分别为Label1、Label2的标签,然后编写如下程序代码: Private X As Integer Private Sub Command1_Click( ) X=5:Y=3 Call proc(X,Y) Label1.Caption=X LabeLCaption=Y End Sub Private Sub proc(ByVal a As Integer,ByVal b As Integer) X=a*a Y=b+b End Sub 程序运行后,单击命令按钮,则两个标签中显示的内容分别是
A.5和3
B.25和3
C.25和6
D.5和6
第5题:
A:对象,属性,属性
B:对象,方法,属性
C:对象,属性,值
D:属性,对象,值
第6题:
执行( )语句,可使窗口的按钮Command1上显示“确定”。
A、 Command1.Show = "确定"
B、 Command1.Caption = "确定"
C、 Command1.Name = "确定"
D、 Command1.Visible = "确定"
第7题:
有程序代码如下:
Textl. Text= "Visual Basic"
则Text1,Text,和气Tisual Basic"分别代表( )。
A. 对象,值,属性
B. 对象,方法,属性
C. 对象,属性,值
D. 属性,对象,值
第8题:
在窗体上画两个标签和一个命令按钮,其名称分别为Labell、Label2和Command1,然后编写如下程序: Private Sub func(L As Label,ByVal a As Integer) L.Caption="1234" a=a*a End Sub Private Sub Form_Load() Label1.Caption="ABCD" Label2.Caption=10 End Sub Private Sub Command1_Click() a=Val(Label2.Caption) Call func(Labell,A)Label2.Caption=a End Sub 程序运行后,单击命令按钮,在两个标签Label1和Label2中显示的内容分别是 ______。
A.ABCD和10
B.1234和100
C.ABCD和100
D.1234和10
第9题:
设计一个表单(如下图所示),判断一个正数是不是素数。
要求:在文本框中输入一个正数,单击“确定”按钮后显示结果,单击“退出”按钮释放表单。
控件的主要属性:
Labe11. Caption=“请输入一个正数:”
Labe12.Caption=“判断结果:”
Command1. Caption=“确定”
Command2. Caption=“退出”
Text1.Value=2
第10题:
在窗体中有一个标签Labele,标题为“测试进行中”,有一个命令按钮Command1,事件代码如下:
Private Sub Command1_Click()
Labele.Caption=“标签”
End Sub
Private Sub Form_Load( )
Form.Caption=“举例”
Command1.Caption=“移动”
End Sub
打开窗体后单击命令按钮,屏幕显示( )。
A.
B.
C.
D.