首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码: Private Sub Text1_KeyPress(KeyAscii As Integer) If "A"
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码: Private Sub Text1_KeyPress(KeyAscii As Integer) If "A"
admin
2015-06-30
47
问题
设窗体上有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://jikaoti.com/ti/D160FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
执行语句Open"TC,dat"ForRandomAs#1Len=50后,对文件TC.dat中的数据能执行的操作是()。
在窗体上面有一个文本框,其名称为Text1,编写如下事件过程:PrivateSubText1_KeyPress(KeyAsciiAsInteger)DimstrAsStringstr=Chr(KeyAscii)
按文件的访问方式不同,可以将文件分为()。
在新建一个VisualBasic工程时,将新建窗体的Name属性设置为TheFirst,则默认的窗体文件名为()。
在窗体上面画一个命令按钮,然后编写如下程序:FunctionM(xAsInteger,yAsInteger)AsIntegerM=IIf(x>y,x,y)EndF
在菜单编辑器中建立一个菜单,名称为mymenu,用下面的语句可以把它作为弹出式菜单弹出,请填空。Form1.【】mymenu
“软件危机”产生的主要原因是______。
公司中有多个部门和多名职员,每个职员只能属于一个部门,一个部门可以有多名职员,从职员到部门的联系类型是
用树形结构来表示实体之间联系的模型称为______。
随机试题
观察舌苔以辨别病邪深浅的主要依据是
A.精神病学B.心理学C.心理咨询D.医学心理学E.心身医学
施工项目应建立安全生产费用管理制度,明确项目安全生产费用提取和使用的程序、职责及权限,按照标准提取安全生产费用在成本中列支,编制安全生产费用(),专门用于完善和改进项目安全生产条件,在相关法律法规规定的范围使用,并建立使用台账。
项目质量控制体系有序运行的基本保证是()。
下列关于防火墙的构造要求说法正确的是()。
企业收到购货单位汇来的前欠货款100万元,此项业务使得()。
在机器零件的生产中,获得毛坯的方法主要有()。
甲化妆品公司(简称甲公司)为增值税一般纳税人,2017年11月份发生下列业务:(1)委托乙公司(增值税一般纳税人)加工高档香水精5吨,甲公司提供的自产原材料不含税价格为40万元,乙公司收取不含税加工费8万元并开具增值税专用发票。乙公司加工完毕后,甲公司委
Whatisthebroadcastmainlyabout?
ThelargestcityinNewZealandis
最新回复
(
0
)