首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设窗体上有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
23
问题
设窗体上有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/ShN0FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
以下程序的功能是随机产生10个两位的整数:OptionBase1PrivateSubCommand1_Click()Dima(10)AsInteger,iAsIntegerRandomizeFori=1To10a(i)=I
语句PrintSgn(-6^2)+Abs(-6^2)+Int(-6^2)的输出结果是()。
下列关于线性表的叙述中,不正确的是()。
设树T的深度为4,其中度为1,2,3,4的结点个数分别为4,2,1,1。则T中的叶子结点数为
在窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮。运行后的窗体外观如图所示。设有如下的类型和变量声明:PrivateTypePersonNameAsString*8:MajorAsStri8ng
在一棵二叉树上,第5层的结点数最多是()。
请根据以下各小题的要求设计VisualBasic应用程序(包括界面和代码)。(1)在名称为Form1标题为“选课”的窗体上画一个复选框数组,名称为CH1,共有四个复选框,按顺序其标题分别是“数学”、“语文”、“外语”、“计算机”,其中“语文”、“计算机
算法的时间复杂度是指()。
检查软件产品是否符合需求定义的过程称为
8.6787E+8写成普通的十进制数是()。
随机试题
等离子焊枪应保证____、____和____。
A.关元俞B.肺俞C.肾俞D.肷俞E.阴俞治疗牛腰胯风湿、腰背闪伤宜选
行唇裂整复术应考虑的问题中,不包括患者的
下列哪些溶剂具有保湿作用
概率的应用方法主要包括( )。
下列关于久期的说法,不正确的是()。
下列选项中,()是基金经理运作基金投资的关键。
A、1/5B、1/3C、3/5D、1C第一步,本题考查数图推理。第二步,第一个圆内12×4=6×8,第二个圆内10×2=5×4,第三个圆内4×4=8×2,圆内存在规律左上×右上=左下×右下,那么1×3=5×?,?为3/5。因此,选择C选项。
硬件抽象层和引导加载程序都属于底层软件。下列各功能中,并非由底层软件实现的功能是()。
Today’scollegestudentsaremorenarcissisticandself-centeredthantheirpredecessors,accordingtoacomprehensivenewstud
最新回复
(
0
)