首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
窗体上有1个名称为Commandl的命令按钮;1个名称为Listl、没有列表项的列表框。编写如下程序: Private Sub Command l_Click() Dim x As String,s As String,temp
窗体上有1个名称为Commandl的命令按钮;1个名称为Listl、没有列表项的列表框。编写如下程序: Private Sub Command l_Click() Dim x As String,s As String,temp
admin
2013-10-16
20
问题
窗体上有1个名称为Commandl的命令按钮;1个名称为Listl、没有列表项的列表框。编写如下程序:
Private Sub Command l_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
List 1.Addltem temp
s=""
temp=""
End If
Next
List 1.Addltem temp
Else
MsgBox”输入内容为空!”
End If
End Sub
程序运行后,单击命令按钮Commandl,并输入“Happy new year”,则在List1中显示的内容为
选项
A、year new Happy
B、Happy new year
C、raey wen yppaH
D、yppaH wen raey
答案
A
解析
本题的循环中倒序从字符串s中依次取出每一个字符,只要该字符不是空格就将其连接到temp的前面,见到空格就把连接好的temp加入到列表框中,即先加入year,然后是new,最后是Happy。
转载请注明原文地址:https://kaotiyun.com/show/uLQp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
面向对象的设计方法与传统的面向过程的方法有本质不同,它的基本原理是______。
在窗体上画一个名为Command1的命令按钮,然后编写如下程序:OptionBase1PrivateSubCommand1_Click()Dimarrarr=Array(358,32,46,73,23,59,
以下说法错误的是______。
以下属性可以用于改变控件大小的是______。
在关系数据库中,元组的集合称为关系。通常标识元组的属性或最小属性组称为【】。
______的主要功能是返回或设置在控件中或在运行时画图或打印操作中,显示文本所用的字体。
在面向对象方法中,类之间共享属性和操作的机制称为______。
在名为Form1的窗体上建立一个二级下拉菜单(菜单项见下表)。注意:文件必须存放在考生文件夹中,工程文件名为CXeCise95.vbp,窗体文件名为execiSe95.frm。
在名为Form1的窗体上绘制一个命令按钮,名为Cmd1,标题为“复制”;再绘制一个文本框,名为Text1。请编写适当的事件过程,使得在运行时,若单击命令按钮,则把按钮上的标题复制到文本框中(如下图所示)。注意:程序中不得使用任何变量;文件
下列关于For...next语句的说法正确的是______。
随机试题
阅读《秋水》中的一段文字,回答下列问题:人卒九州,谷食之所生,舟车之所通,人处一焉;此其比万物也,不似毫末之在马体乎?五帝之所连,三王之所争,仁人之所忧,任士之所劳,尽此矣。伯夷辞之以为名,仲尼语之以为博,此其自多也,不似尔向之自多于水乎?请
维生素是维持动物体正常生理代谢和机能所必需的一类低分子化合物,其作用是其他物质所无法替代的。可用于高热、重度损伤及牛酮血症、神经炎、心肌炎的辅助治疗的维生素为
关于建筑面积以下说法正确的是()。
下列关于招标控制价的说法不正确的是()。
下列属于成本类科目的是()。
真理的相对性应该理解为
Threepassions,simplebutoverwhelminglystrong,havegovernedmylife:thelongingforlove,thesearchforknowledge,andunb
对长度为n的线性表进行顺序查找,在最坏情况下所需要的比较次数为
Whereisthisconversationprobablytakingplace?
RecreationalrunnerCarrieJohnstonusuallydoesn’tfeelhungryafteragoodsweat.Exercise【C1】______Johnston’sappetite,bu
最新回复
(
0
)