题目详情
当前位置:首页 > 计算机考试 > 初级程序员
题目详情:
发布时间:2023-11-05 04:02:51

[简答题][Vsual Basic 程序代码] Private Sub CmdSelect_Cliek( ) For i = O To List2.ListCount - 1 If Listl.Text = List2.List(i) Then Exit Sub ’不要重复选择 Next i List2.Addltem (1) ’在List2中增添List1中所选的项 End Sub Private Sub CrndSelAll_Click( ) List2.Clear ’先删除List2中的已有项 For i = 0 To (2) ’对List1中所有各项做循环处理 List2.Addltem (3) ’将该项增添到 List2中 Next i End Sub Private Sub CmdDelete_Cliek( ) If List2.Listlndex >= O Then ’如果List2中有选中的项, List2.Removeltem (4) ’则删除所选的项 End If End Sub Private Sub CmdDelAll_Cliek( ) (5) End Sub

更多"[Vsual Basic 程序代码] Private Sub "的相关试题:

[单项选择]在窗体中添加一个命令按钮和一个文本框,并编写如下程序代码:
Private Sub Command1_Click( )
  k = 0
  Do While k < 70
    k = k + 2
    k = k * k + k
    a = a + k
  Loop
  Text1.Text = a
End Sub
程序运行后,文本框中显示________。
(A) 20
(B) 32
(C) 44
(D) 78
[单项选择]单击命令按钮时,下列程序代码的执行结果为
Private Sub Command1_Click( )
Print MyFunc(24,18)
End Sub
Public Function MyFunc(m As Integer,n As Integer)As Integer
Do While m ◇ n
Do While m>n:m=m—n:Loop
DO While m<n:n=n-m:Loop
Loop
My Func=m
End Function
A. 2
B. 4
C. 6
D. 8
[单项选择]单击窗口时,下列程序代码的执行结果为 
Private Sub Form_Click( )
Text1
End Sub
Private Sub Text(x As Integer)
x=x*3+1
if x<6 Then
call Text(x)
End if
x=x*2+1
Print x;
End Sub
A. 27 55
B. 11 35
C. 22 45
D. 24 51
[单项选择]单击命令按钮时,下列程序代码的运行结果为( )。   Private Sub Command1_Click( )     print MyFunc(20,18)   End Sub   Public Function MyFunc (m As Integer,n As Integer)As Integer     Do While m <>n       Do While m > n:m=m - n:Loop       Do While m < n:n=n - m:Loop     Loop     MyFunc=m   End FunCtion
A. Dim gg[1,5]As String
B. Dim gg[1 To 5,1 To 5]As String
C. Dim gg(1 To 5)As String
D. Dim gg[1:5,1:5]As String
[单项选择]单击命令按钮时,下列程序代码的运行结果为
Private Sub Command1_Click( )
Print MyFunc(20, 18)
End Sub
Public Function MyFunc(m As Integer, n As Integer)As Integer
Do While m<>n
Do While m>n:m=m-n:Loop
Do Whle m<n:n=n-m:Loop
Loop
MyFunc=m
End Function
A. 0
B. 2
C. 4
D. 6
[单项选择]单击一次命令按钮之后,下列程序代码的执行结果为
private Sub Command1_Click( )
S=P(1) +P(1)+P(2)+P(3)+P(4)
Print S:
End Sub
Public Function P(N As Integer)
Static Sum
For I=1 To n
Sum=Sum+I
Next 1
P=Sum
End Function
A. 20
B. 35
C. 115
D. 135
[单项选择]单击一次命令按钮,下列程序代码的执行结果为( )。 Private Sub Commandl_Click( ) Dima As Integer,b As Integer,CASInteger a=2:b=3:c=4 PrintP2(c,b,a) End Sub PrivateFunctionPl(X As Integer,y As Intege;z As Integer) P1=2*x+y+3*Z End Function PrivateFunctionP2(X As Integer,y As Integer,z As Integer) P2=P1(z,x,y)+x End Function
A. 21
B. 19
C. 17
D. 34
[单项选择]已知c:/1.txt是一个非空文件,其程序代码如下。 Private Sub Command1_Click( ) Dim MaxSize,NextChar,MyChat Open"c:/1.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(1) Close #1 End Sub 程序运行后,单击命令按钮,其输出结果为______。
A. True
B. Null
C. 0
D. False
[单项选择]单击命令按钮时,下列程序代码的执行结果为( )。
Private Sub Procl(nAs Integer,ByValmASInteger)
n=nMod 10
m=m/10
End Sub
PrivateSubCommandl_Click( )
Dimx As Integer
Dimy As Integer
x=12
y=34
CallProcl(x,y)
Printx;y
End Sub
A. 12 34
B. 2 34
C. 2 3
D. 12 3
[单项选择]单击一次窗体之后,下列程序代码的执行结果为______ 。 Private Sub Command1_ Click( ) Dim x As Integer, y As Integer, z As Integer x = 1: y = 2: z = 3 Call fun1 (x, y, z) Print x; y; z Call fun2(x, y, z) Print x; y; z End Sub Private Sub fun1(x As Integer, y As Integer, z As Integer) x = 10 * z y=z*z+ x z=x+ y+ z End Sub Private Sub fun2 (ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) x=10*z y=z*z+ x z=x+ y +z End Sub
A. 1 2 3 30 39 72
B. 1 2 3 1 2 3
C. 30 39 72 1 2 3
D. 30 39 72 30 39 72
[简答题]

【Visual Basic代码】
Private Sub Drivel_Change( )
Dirl.Path= (1) ’户选择的驱动器反映到目录列表框中
End Sub
Private Sub Dirl_Change( )
Filel.Path= (2) ’用户选择的文件夹改变文件列表框内容
End Sub
Private Sub sum_Click( )
Dim (3) As New FileSystemOject, (4) As TextStxeam
’创建自己的文件系统对象,说明自己的文本流对象
If Right (Dirl.Path,1)="/"Then
SetmyTextFile=fso.OpenTextFile (Dirl.Path+Filel.FileNamc)
Else
SetmyTextFile=fso.OpenTextFile(Dirl.Path+”/’+Filel.FileName)
End“
S=0
Do
d=Val (myTextFilE.ReadRow)
S=S+d
Loop While (5)
Textl.Text=Str$(S)
End Sub


[单项选择]单击一次命令按钮之后,下列程序代码的执行结果为______ 。 Private Sub Command1_ Click( ) a = fun(4) + fun(5) Print a; End Sub Public Function fun (n As Integer) Static Num For i = 1 To n Num = Num + i Next i fun = Num End Function
A. 15
B. 20
C. 35
D. 40
[单项选择]单击命令按钮时,下列程序代码的执行结果为______。
Private Sub Proe1 (n As Integer,ByVa1 m As Integer)
n=n Mod 10
m=m/ 10
End Sub
Private Sub Command1_Click( )
Dim x As Integer
Dim y As Integer
x= 12
y = 34
Call Proe1 (x, y)
Print x; y
End Sub
A. 12 34
B. 2 34
C. 2 3
D. 12 3

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码