更多"在窗体上画一个列表框、一个命令按钮和一个标签。程序运行后,在列表框中选"的相关试题:
[填空题]在窗体上画一个列表框、一个命令按钮和一个标签。程序运行后,在列表框中选择一个项目,然后单击命令按钮,即可将所选择的项目删除,并在标签中显示列表框当前的项目数,运行情况如图6-1所示。下面是实现上述功能的程序,请填空。
Private Sub Form_Load( )
List1.AddItem "AAAAA"
List1.AddItem "BBBBB"
List1.AddItem "CCCCC"
List1 .AddItem "DDDDD"
End Sub
Private Sub Command1_Click( )
Dim L1 As Integer
L1 =
If L1 > = 0 Then
List1.RemoveItem______
Label1.Caption =
Else
MsgBox"请选择要删除的项目"
End If
End Sub
[单项选择]在窗体上画一个命令按钮和一个标签,其名称分别为Command1和Labell,然后编写如下事件过程: Private Sub Command1_Click( ) Counter=0 For i=1 To 4 For j=8 To 1 Step-2 Counter=Counter+1 Next i Next i Labell.Caption=Str(Counter) End Sub 程序运行后,单击命令按钮,标签中显示的内容是
A. 11
B. 12
C. 16
D. 20
[单项选择]在窗体上画一个命令按钮和一个标签,其名称分别为Command1和Labe11,然后编写如下事件过程:
Private Sub Command1_Click( )
Counter=0
For i=1 To 4
For j=8 To 1 Step-2
Counter=Counter+1
Next j
Next i
Labe11.Caption=Str(Counter)
End Sub
程序运行后,单击命令按钮,标签中显示的内容是______。
A. 11
B. 12
C. 16
D. 20
[单项选择]在窗体上画一个命令按钮和一个标签,其名称分别为Command1和Label1,然后编写如下事件过程:
Private Sub Command1_Click( )
Counter=0
For i=1 To 4
For j=6 To 1 Step -2
Counter=Counter+1
Next j
Next i
Label1.Caption=Str(Counter)
End Sub
程序运行后,单击命令按钮,标签中显示的内容是
A. 11
B. 12
C. 16
D. 20
[单项选择]在窗体上画一个命令按钮,名称为Command1。单击命令按钮时,执行如下事件过程:
Private Sub Command1_Click( )
a$="software and hardware"
b$=Right(a$,8)
c$=Mid(a$,1,8)
MsgBox a$,,b$,c$,1
End Sub
则在弹出的信息框的标题栏中显示的信息是( )。
A. software and hardware
B. software
C. hardware
D. 1
[单项选择]在窗体上画一个命令按钮,名称为Comraandl。单击该命令按钮时,执行如下事件过程:
Private Sub Command1_Click( )
a$="software and hardware"
b$=Right(a$, 8)
c$=Mid(a$, 1, 8)+b$
MsgSox a$, 1, b$
End Sub
则在弹出的消息框的标题栏中显示的信息是______。
A. software and hardware
B. software
C. hardware
D. 1
[单项选择]在窗体上画一个命令按钮,然后编写如下代码: Private Type Record ID As Integer Name As String *20 End Type Private Sub Command1_Click( ) Dim Maxsize, NextChar, MyChar Open "d:/temp/female.txt" For Input As #1 Maxsize = LOF(1) For NextChar = Maxsize To 1 Step -1 Seek #1, NextChar MyChar = Input(1, #1) Next NextChar Print EOF(I) Close 31 End Sub 程序运行后,单击命令按钮,其输出的结果为
A. True
B. False
C. 0
D. Null