首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码: Private Sub Text1_KeyPress(KeyAscii As Integer) If "A"
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码: Private Sub Text1_KeyPress(KeyAscii As Integer) If "A"
admin
2019-06-20
21
问题
设窗体上有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/HfUp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
双精度浮点数的类型说明符为
在属性窗口中把窗体的KeyPreview属性设置为True,然后编写如下两个事件过程:PrivateSubForm_KeyDown(KeyCodeAsInteger,ShiftAsInteger)PrintChr(KeyC
假定窗体上有一个标签,名为Label1,为了使该标签透明并且没有边框,则正确的属性设置为()。
在软件开发中,需求分析阶段可以使用的工具是
在VisualBasic中,不能关闭的窗口是
下列说法中,错误的是
有数据定义语句:DimX,YAsInteger以上语句表明
设树T的深度为4,其中度为1,2,3,4的结点个数分别为4,2,1,1。则T中的叶子结点数为
若要把窗体上命令按钮Command1的状态设置为不可用,应该执行的命令是
(1)在标题为“列表框”、名称为Form1的窗体上添加一个名称为List1的列表框,通过属性窗口输入4个列表项:“数学”、“语文”、“历史”、“地理”,列表项形式采用复选框形式,如图所示。列表框的宽为1100,高不限。注意:存盘时必须存放在考生文
随机试题
醉酒驾驶机动车在道路上行驶会受到什么处罚?
用可能性和现实性的关系解释“水中捞月”和“大海捞针”这两句话的异同()
熟地的作用是长于
A、奥美拉唑B、盐酸赛庚啶C、富马酸铜替芬D、西咪替丁E、法莫替丁结构中含有苯并咪唑环的质子泵抑制剂
“地西泮5mg.po.sos.”属于
裱糊工程中裱糊后的壁纸出现起鼓或脱落,下述哪项原因分析是不正确的?[2006年第44题]
[2005年第59题]高层建筑内设置消防水泵房,以下要求哪条有错?
奥通公司为增值税一般纳税人,适用的增值税税率为17%。2014年12月1日“应付职工薪酬”科目的贷方余额为258万元(其中工资122万元、工会经费2.5万元、职工教育经费12万元、设定提存计划121.5万元)。该企业2014年12月份发生的有关职工薪酬业务
5M1E的5M中,()是最活跃的因素。
设g(x)可导,|g’(x)|<1,且当a≤x≤b时,a<g(x)<b,又x+g(x)-2f(x)=0,若{xn}满足xn+1=f(xn),n=0,1,2,…,x0∈[a,b]。证明:唯一的ξ∈[a,b],使得f(ξ)=ξ.
最新回复
(
0
)