首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码: Private Sub Text1_KeyPress(KeyAscii As Integer) If "A"
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码: Private Sub Text1_KeyPress(KeyAscii As Integer) If "A"
admin
2015-08-28
35
问题
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If "A" <= Chr(KeyAscii) And Chr(KeyAscii) <= "Z" Then
KeyAscii = KeyAscii + (Asc("a") - Asc("A"))
End If
n = 0
If KeyAscii = 13 Then
For k = 1 To Len(Text1)
ch$ = Mid(Text1, k, 1)
If "a" <= ch And ch <= "z" Then n = n + 1
Next k
Text2 = n
End If
End Sub
程序运行时,在Text1文本框中输入"Visual Basic 6.0"后按回车键,则在Text2文本框显示的是
选项
A、11
B、16
C、Visual Basic 6.0
D、visual basic 6.0
答案
A
解析
Text1_KeyPress过程中,先把输入的字符串中大小字母变成小写字母。当按下回车键后,执行For循环统计小写字母的个数。退出循环后把n值赋给Text2。选A)。
转载请注明原文地址:https://kaotiyun.com/show/QILp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
软件生命周期是指______。
设窗体上有一个文本框,名称为Text1,程序运行后,要求该文本框只能显示信息,不能接收输入信息,以下能实现该操作的语句是______。
设有语句:X=InputBox("输入数值","0","示例")程序运行后,如果从键盘上输人数值10并按回车键,则下列叙述中正确的是______。
下列关于源程序文档化的说法不适宜的是______。
在窗体上画一个文本框和一个图片框,然后编写如下两个事件过程:PrivateSubForm_Click()Text1.Text="VBProgramming"EndSubPrivateSubTextl_Cha
下列事件过程的功能是:建立一个名为Datal的随机文件,存放角度值及这些角度的正弦函数值和余弦函数值,角度为1,2,3,…,90。请在空白处填入适当的内容,将程序补充完整()。PrivateTypeAngKAsInt
设当前日期为2007年12月27日,星期四,则执行下面语句后的输出结果为______。PrintDay(Now)PrintMonth(Now)PrintYear(Now)PrintWeekday(Now)
如果一个工程含有多个窗体及标准模块,则以下叙述中错误的是______。
算法的时间复杂度是指______。
树中度为零的结点称为______。
随机试题
下列影响学生学习的动机中属于内在学习动机的是()
Beforethewarbrokeout,manypeople_______insafeplacespossessionstheycouldnottakewiththem.
以下药物服用后不宜立即大量饮水的是()。
下列说法错误的是()。
2006年7月10日,甲与乙订立买卖合同,以500万元的价格向乙购买一套精装修住房。当日,甲支付了40万元定金,乙将房屋交付给甲。双方约定:甲应于8月1日前付清余款;乙应在收到余款后两日内办理房屋过户手续。7月15日,当地突降特大暴雨,该房屋被淹没,损失额
根据以下材料,回答下列问题。第五次全国人口普查以2000年11月1日零时为标准时点,S省常住人口34714835人。根据《全国人口普查条例》和国务院的决定,我国在2010年又以11月1日零时为标准时点进行了第六次全国人口普查。下面是S省常住人口的地区
“儿童心理发展等于遗传与环境的乘积”。这种观点是()
(2012年真题)以法律的地位、效力、内容和制定主体为标准,法律可以分为()。
我国基本政治制度有()
某棵树中共有25个节点,且只有度为3的节点和叶子节点,其中叶子节点有7个,则该树中度为3的节点数为()。
最新回复
(
0
)