单选题以下叙述中错误的是( )。
单选题执行下列程序段
a$="Visual Basic Programming"
b$="C++"
e$=UCase(Left$(a$,7))&b$&Right$(a$,12)
后,变量c$的值为______。
单选题假定在图片框Picture1中装入了一个图片,在程序运行中,为了清除该图片(注意,清除图片,而不是删除图片框),应采用的正确方法是______。
A.单击图片框,然后按Del键
B.执行语句Picture1.Picture=LoadPicture("")
C.执行语句Picture1.Picture=""
D.执行语句:Picture1.Cls
单选题函数Int(Rnd * 6+1)的取值范围是________。
单选题以下关于单选按钮和复选框的叙述中,正确的是
单选题在窗体上画一个命令按钮,然后编写如下代码:
Private Sub Command1_Click()
0pen "d:/vb/test.txt "For Input As #1
Print LOF(1)
Close #1
End Sub
假设文件d:/vb/test.txt的内容为I am a student.,那么程序运行后,单击命令按钮,其输出结果为______.
单选题为了克服软件危机,人们提出了用______的原理来设计软件,这就是软件工程诞生的基础。
单选题下面函数的功能应该是:删除字符串s仃中所有与变量ch相同的字符,并返回删除后的结果。例如:若str=“ABCDABCD”,ch=“B”,则函数的返回值为:“ABCDCD” Function delchar(str As String,ch As String)As String Dim k As Integer,temp As String,ret As String Ret="" For k=1 To Len(str) Temp=Mid(str,k,1) Iftemp=ch Then ret=ret temp End If Next k delchar=ret End Function 但实际上函数有错误,需要修改。下面的修改方案中正确的是
单选题编写如下事件过程: Private Sub Form_MouseMove(ButtonAsInteger,ShiftAsInteger,X As Single,YAsSingle) Cls If(Button Andl)ThenPrint"你好" End Sub 程序运行后,为了在窗体上显示“你好”,应在窗体上执行以下( )操作。
单选题当程序运行时,在窗体上单击鼠标,以下那个事件是窗体不能响应的事件
单选题假设变量boolVar是一个布尔型变量,则下面正确的赋值语句是< )。
单选题在窗体上画一个命令按钮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
Private Sub Form_KeyDown(KeyCode As Integer,Shift As Integer)
str2=str2 & Chr(KeyCode)
End Sub
Private SubCommand1_Click()
Text1.Text=str1
Text2.Text=str2
str1=""
str2=""
End Sub
当在设计阶段的窗体的KeyPreview属性设置为True时,程序运行过程中,在键盘上输入小写字母abc,然后单击命令按钮,则文本框Text1中显示的内容为
单选题设有如下通用过程:
Public Function Fun(xStr As String)As String
Dim tStr As String,strL As Integer
tStr=""
strL=Len(xStr)
i=strL/2
Do Whlle i<=strL
tStr=tStr & Mid(xStr,i+1,1)
i=i+1
Loop
Fun=tStr & tStr
End Function
在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮。然后编写如下的事件过程:
Private Sub Command1_Click()
Dim S1 As String
S1="ABCDEF"
Textl.Text=LCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,文本框中显示的是______。
单选题窗体上画了两个按钮Command1和Command2,有如下程序: Private Sub Conunand1_Click( ) Print "Visual"; End Sub Private Sub Command2_Click( ) Print "Basic"; End Sub Private Sub Form_Load( ) Comraand2. Cancel=True Coramand1. Cancel=True End Sub 执行程序后,按键盘Cancel键,在窗体上输出结果是______。
单选题下列不属于主窗口的是______。 A) 最大化按钮 B) 状态栏 C) 系统菜单 D) 工具栏
单选题运行以下程序后,输出的结果是( )。 Print"中国" Font="隶书" Print"人民" Font="仿宋" Print"万岁" Font="宋体"
单选题使用Do While循环从打开的文件中逐条读取记录,以下能够正确读取数据的程序是______。 A) Open " c:/File1.txt" For Input As #1 Do While Not EOF() Line Input #1, strline …… Loop B) Open " c:/Filel.txt" For Input As #1 Do While Not EOF(1) Line Input #1, strline …… Loop C) FileNo=FreeFile Open "c:/File1.txt" For Input As #1 Do While Not EOF(FileNo) Line Input #1 , strline …… Loop D) FileNo=FreeFile Open "c: /File1.txt" For Input As #1 Do While Not EOF(#FileNo) Line Input #1, strline …… Loop
单选题要使一个文本框可以显示多行文本,应设置为True的属性是
A.Enabled
B.MultiLine
C.MaxLength
D.Width
单选题编写如下程序:
Private Sub Command1_Click() Dim x As Integer x=10
Print fun1(x, 12)+x
End Sub
Private Function fun 1(m As Integer, n As Integer)As Integer
If n>10 Then m=n
fun1=m+n
End Function
程序运行后,单击命令按钮Command1,输出结果为
单选题在窗体中有一个名为Command1的命令按钮,并编写有以下代码。程序执行时,单击命令按钮,输出的结果为( )。Public Sub Procl(n As Integer,ByVal m AS Integer)n=n Mod10:m=m/10End SubPrivate Sub Command1_Click()Dim x As Integer,y As Integerx=12:y=34Call Procl(x,y)Printx;yEnd Sub