单选题
VB
题号 #484368
在窗体上画两个滚动条,名称分别为Hscroll1、Hscroll2;六个标签,名称分别为Label1、Label2、Label3、Label4、Label5、Label6,其中标签Label4.Label6分别显示“A”、“B”、“A*B”等文字信息,标签Label1、Label2分别显示其右侧的滚动条的数值,Label3显示A*B的计算结果。如下图所示。当移动滚动框时,在相应的标签中显示滚动条的值。当单击命令按钮“计算”时,对标签Label1、Label2中显示的两个值求积,并将结果显示在Label3中。以下不能实现上述功能的事件过程是
( )
A.Private Sub Command1_Click()
Label3.Caption=Str(Val(Label1.Caption) *Val(Label2.Caption))
End Sub
B.Private Sub Command1_Click()
Label3.Caption=Hscroll1.Value*HScroll2.Value
End Sub
C.Private Sub Command 1_Click()
Label3.Caption=Hscroll1 *HScroll2
End Sub
D.Private Sub Command 1_Click()
Label3.Caption=Hscroll1.Text*HScroll2.Text
End Sub
参考答案
D
答案解析
滚动条不具有Text属性,所以,选项D不能实现题目要求的功能.答案是D。请注意滚动条的控件值是Value,Hscroll1.Value与Hscroll1表示的含义相同。
你可能感兴趣的试题
A.Private Sub List1_Click()
Label 1.Caption=List1.ListIndex
End Sub
Label 1.Caption=List1.ListIndex
End Sub
B.Private Sub List1_Clicd()
Label1.Name=List1.ListIndex
End Sub
Label1.Name=List1.ListIndex
End Sub
C.Private Sub Listl_Click()
Label1.Name=List1.Text
End Sub
Label1.Name=List1.Text
End Sub
D.Private Sub List 1 Click()
Label 1.Caption=List 1.Text
End Sub
Label 1.Caption=List 1.Text
End Sub