首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码: Private Sub Text1_KeyPress(KeyAscii As Integer) If "A"
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码: Private Sub Text1_KeyPress(KeyAscii As Integer) If "A"
admin
2020-07-22
22
问题
设窗体上有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/LCHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
窗体上有1个名称为Command1的命令按钮,事件过程如下:PrivateSubCommand1_Click(Dimarr_x(5,5)AsIntegerFori=1To3Fori=2To4
窗体上有一个名称为Text1的文本框,一个名称为Commandl的命令按钮。要求编写一个程序,统计文本框中0-9各数字字符的个数。某人编写如下程序:PrivateSubCommandl_Click()Dimcount(10)AsInteger第
在VisualBasic中,不能关闭的窗口是
下列合法的变量名是
对长度为n的线性表排序,在最坏情况下,比较次数不是n(n-1)/2的排序方法是( )。
三角形的构成条件是:任意2边之和大于第3边。设变量a、b、c是3条直线的长度,要求判断这3条直线能否构成一个三角形。下面有3个程序段可以正确判断,另一个不能正确判断的是
(1)考生文件夹下有一个工程文件sjt3.vbp,其窗体上有1个名称为Text1的控件数组;一个标题为”排序”的命令按钮。程序运行时,在文本框数组中输入8个整数,如图3-29(a)所示;然后单击”排序”按钮,则8个整数按降序排序,如图3-29(b)所示。
对长度为n的线性表作快速排序,在最坏情况下,比较次数为
随机试题
可以充分化解各种矛盾,增进组织的内部团结,调动群众和基层单位的积极性的行为是
急性细菌性痢疾的典型肠道病变为
关于全口义齿印模的叙述,错误的有
下列描述中( )不符合施工作业过程质量控制的基本程序。
散文家:智慧与聪明是令人渴望的品质。但是,一个人聪明并不意味着他很有智慧,而一个人有智慧也不意味着他很聪明。在我所遇到的人中,有的人聪明,有的人有智慧,但是,却没有人同时具备这两种品质。若散文家的陈述为真,以下哪项陈述不可能真?
三段论就是由两个包含着共同项的性质命题作前提推出一个性质命题为结论的推理。根据上述定义,下列选项属于三段论的是()。
某种密码锁有6位,每位均有相同的3个字母可选,已知唯一正确的密码用到所有3个字母,若尝试一次,该密码被破解的概率()。
减刑的条件包括( )。
SQL的含义是()。
He______themountainsquiteafewtimesbeforemakingapaintingofthem.
最新回复
(
0
)