首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
窗体上有1个名称为Command1的命令按钮;1个名称为List1、没有列表项的列表框。编写如下程序: Private Sub Command1_Click() Dim x As String, s As String, temp As String
窗体上有1个名称为Command1的命令按钮;1个名称为List1、没有列表项的列表框。编写如下程序: Private Sub Command1_Click() Dim x As String, s As String, temp As String
admin
2020-06-30
21
问题
窗体上有1个名称为Command1的命令按钮;1个名称为List1、没有列表项的列表框。编写如下程序:
Private Sub Command1_Click()
Dim x As String, s As String, temp As String
Dim i As Integer
x = InputBox("输入字符串", "输入")
If x <> "" Then
For i = Len(x) To 1 Step -1
s = Mid(x, i, 1)
If s <> " " Then
temp = s + temp
Else
List1.AddItem temp
s = ""
temp = ""
End If
Next
List1.AddItem temp
Else
MsgBox "输入内容为空!"
End If
End Sub
程序运行后,单击命令按钮Command1,并输入"Happy new year",则在List1中显示的内容为
选项
A、year new Happy
B、Happy new year
C、raey wen yppaH
D、yppaH wen raey
答案
A
解析
List1.AddItem可以为列表框添加列表项。For循环中通过Mid函数从字串中倒序取出字符,碰到空格时添加新列表项。选A。
转载请注明原文地址:https://kaotiyun.com/show/1LHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
某人编写了下面的程序,希望能把Text1文本框中的内容写到out.txt文件中:PrivateSubCommand1_Click()Open"out.txt"ForOutputAs#2Print"Text1"
以下程序执行后,在窗体上输出的图案是()。Forml.ClsFora=1To5PrintSpace(5一a);String(a,”*”)Nexta
数据字典(DD)所定义的对象都包含于
下面列表框属性中,是数组的是( )。
设窗体上有一个文本框Text1和一个命令按钮Command1,并有以下事件过程:PrivateSubCommand1_Click() DimsAsString,chAsString s="" Fork=1ToLen(Te
在考生文件夹下有一个工程文件sjt3.vbp,其功能是:①单击“读数据”按钮,则把考生文件夹下in3.dat文件中的100个正整数读入数组a中;②单击“统计”按钮,则找出这100个正整数中的所有完全平方数(一个整数若是另外一个整数的平方,那么它就是完全平方
从键盘上输入一个浮点数asingle,利用字符串函数对该数进行处理后,如果输出的内容不是“非浮点数”,则对程序输出的内容分析正确的是()。asingle=Input,Box(“请输入一个浮点数:”)strl$=Str$(asin
在数据库系统的组织结构中,下列()映射把用户数据库与概念数据库联系了起来。
将E—R图转换为关系模式时,实体和联系都可以表示为()。
算法的空间复杂度是指( )。
随机试题
甲委托乙为其购买木材,乙为此花去了一定的时间和精力,现甲不想要这批木材,于是打电话告诉乙取消委托,乙不同意。下列论述正确的是()
人工合成的炔雌醇的药代动力学下列叙述正确的是:
严重贫血时出现晕厥、神志模糊是什么原因
流行性乙型脑炎的主要传染源是
甲有一条驳壳船租与乙进行海上运输,租期3年。双方签订了书面合同,乙一次性向甲交付租金50万元。租赁的第二年,甲因资金紧张将该船卖与丙,双方签订了买卖合同,价格500万元。约定在乙的租期届满前。丙付清全部款项。因甲无法现实交付,双方约定租期届满,由丙向乙行使
【2009年第62题,2010年第61题】预应力混凝土结构的混凝土强度等级不应低于:
按我国《商业银行法》规定,设立全国性商业银行的注册资本最低限额为()亿元。
背景说明:你是宏远公司秘书钟苗,下面是行政经理张明需要你完成的几项任务。
在一桩涉嫌贩卖冰毒的案件中,证人小康起了关键证明作用,下列表述错误的是()。
ChristmasisaholidayusuallycelebratedonDecember25th________thebirthofJesusChrist.
最新回复
(
0
)