单选题窗体上有一个Text1文本框、一个Command1命令按钮,并有以下程序:PrivateSubCommand1_Click()DimnIfText1.Text<>"123456"Thenn=n+1Print"口令输入错误"&n&"次"EndIfEndSub希望程序运行时得到图1所示的效果,即:输入口令,单击“确认口令”命令按钮,若输入的口令不是“123456”,则在窗体上显示输入错误口令的次数。但上面的程序实际显示的是图2所示的效果,程序需要修改。下面修改方案中正确的是______。图1图2
单选题在窗体上画一个命令按钮和两个标签,其名称分别为Command1、Label1和Label2,然后编写如下事件过程: Private Sub Command1_Click() a=0 For i=1 To 10 a=a+1:b=0 For j=1 To 10 a=a+1:b=b+2 Next j Next i Label1.Caption=Str(
单选题在窗体上画一个文本框,其名称为Text1,然后编写如下事件过程: Private Sub Text1_KeyPress(KeyAscii As Integer) Dim str As String Str=Chr(KeyAscii) KeyAscii=Asc(UCase(str)) Text1.Text=String(2, KeyAscii) End Sub 程序运行后,如果在键盘上输入字母“b”,则在文本框Text1中显示的内容是( )。 A) bbb B) BBB C) BB D) bb
单选题下列程序的功能是调用字体对话框来设置文本框中的字体,单击Command1按钮弹出对话框,进行相应的字体、字号等的设置,然后单击“确定”按钮退出对话框,则文本框中将发生哪些变化( )。 Private Sub Command1_Click() CommonDialog1.CancelError=True CommonDialog1.Flags=3 On Error Resume Next CommonDialog1.ShowFont Text1.Font.Name=CommonDialog1.FontName Text1.Font.Size=CommonDialog1.FontSize Text1.Font.Bold=CommonDialog1.FontBold Text1.Font.Italic=CommonDialog1.FontItalic Text1.Font.Underline=CommonDialog1.FontUnderline Text1.FontStrikethru=CommonDialog1.FontStrikethru Text1.ForeColor=CommonDialog1.Color End Sub
单选题下面对软件测试描述错误的是
单选题设有下面程序代码:
Private Sub Command1_Click()
Dim str As String,ch As String
str="Visual Basic Programming":ch="a"
n=fun(ch,str):Print str,n
End Sub
Privme Function fun(ch As String,sir As String)As Integer
Dim strbufAs String,c As String,n As Integer
For k=1 To Len(str)
c=Mid$(str,k,1)
Ifc<>ch Then
strbuf=strbuf&c
Else
strbuf=strbuf&UCase(c):n=n+1
End If
Next k
str=strbuf:fun=n
End Function
程序运行时的输出是
单选题下面关于标准模块的叙述中错误的是( ) A.标准模块中可以声明全局变量 B.标准模块中可以包含一个Sub Main过程,但此过程不能被设置为启动过程 C.标准模块中可以包含一些Public过程 D.一个过程中可以包含有多个标准模块
单选题只能用来显示字符信息的控件是( )。 A) 文本框 B) 标签框 C) 图片框 D) 图像框
单选题在窗体上画一个文本框,然后编写如下事件过程。当该程序运行后,如果在键盘上输入字母“a”,则文本框中显示的内容为 ______。 Private Sub Text1_KeyPress<KeyAscii As Integer) Dim char as String char=Chr(KeyAscii) Text1.Text=String(5,KeyAscii) End Sub
单选题下面可以正确定义2个整型变量和1个字符串变量的语句是
单选题数据库系统的三级模式不包括( )。
单选题窗体上有两个水平滚动条HV、HT,还有一个文本框Text1和一个标题为“计算”的命令按钮Command1,并编写了下列程序:PrivateSubCommand1_Click()Callcale(HV.Value,HT.Value)EndSubPublicSubcale(xAsInteger,yAsInteger)Text1.Text=x*yEndSub运行程序,单击“计算”按钮,可根据速度与时间计算出距离,并显示计算结果。对以上程序,下列叙述中正确的是()。
单选题下列程序段的执行结果为{{U}} {{/U}}。
X=2.4:Z=3:K=5 Print"A(";X+Z*K;")"
A.A(17)
B.A(17.4)
C.A(18)
D.A(2.4+3*5)
单选题窗体上有一个名称为Shapel并显示为圆的形状控件(其Width和Height属性值相等),一个名称为Timerl的计时器,并有下面程序代码:
Dim r As Single.flag As Integer Private Sub Timerl_Timer()
Private Sub Form_Load() Ifflag=0 Then
r=Shapel.Width Shapel.Width=Shapel.Width-10
Timerl.Enabled=True If Shape 1.Width=r Then
flag=0
End If
End If
End Sub
运行程序后产生的结果是
单选题设窗体上有一个标签Label1和一个计时器Timer1,Timer1的Interval属性被设置为1000,Enabled属性被设置为True。要求程序运行时每秒在标签中显示一次系统当前时间。以下可以实现上述要求的事件过程是______。
A.Private Sub Timer1_Timer() Label1.Caption=True
End Sub
B.Private Sub Timer1_Timer() Label1.Caption=Time$
End Sub
C.Private Sub Timer1_Timer() Label1.Interval=1 End
Sub
D.Private Sub Timer1_Timer() For k=1 To Timer1.Interval
Label1.Caption=Timer Next k End Sub
单选题执行如下两条语句后,窗体上显示的是______。 a=9.8596 Print Format(a,"$00 ,00.00") A) 0,009.86 B) $9.68 C) 9.68 D) $ 00,09.86
单选题单击命令按钮执行以下程序,则输出结果为( )。 Private Sub Command1_Click() Dim x As Integer,y As Integer X=14:y=48 Call Proc(x,y) Print x;y End Sub Public Sub Proc(n As Integer,ByVal m As Integer) n=n Mod 10:m=m Mod 10 End Sub
单选题若在某窗体模块中有如下事件过程Private Sub Commandl_Click(Integer)End Sub则以下叙述中正确的是
单选题为了使一个窗体从屏幕上消失但仍在内存中,所使用的方法或语句为( )。
单选题Visual Basic程序中语句行的续行符是( )