首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设窗体上有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
17
问题
设窗体上有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/YELp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在面向对象方法中,类之间共享属性和方法的机制称为______。
下列程序段的执行结果为()。a=75Ifa>60Theni=1Ifa>70Theni=2Ifa>80Theni=3Ifa<90Theni=4Print"i=";i
在窗体上有一个文本框控件,名称为TextTime,一个计时器控件,名称为Timer1。要求每一秒在文本框中显示一次当前的时间。PrivateSubTimer1_TextTime.Text=TimeEnd
下列关于Sub过程的叙述正确的是()。
要利用通用对话框控件来显示“保存文件”对话框,需要调用控件的______方法。
在进行模块测试时,要为每个被测试的模块另外设计两类模块:驱动模块和承接模块(桩模块)。其中【】的作用是将测试数据传送给被测试的模块,并显示被测试模块所产生的结果。
设有语句:x=InputBox("输入数值","0","示例")程序运行后,如果从键盘上输人数值10并按回车键,则下列叙述中正确的是______。
定义变量如下:DimStr_xStr_x="祝你成功!"若在立即窗口中显示Str_x的值,下面正确的是______。
下列叙述正确的是()。
面向对象的设计方法与传统的面向过程的方法有本质不同,它的基本原理是______。
随机试题
行全子宫切除,保留双侧附件,不须切断的韧带是( )
浅反射包括
以下不应该在“预收账款”科目中登记的是()。
事业单位的材料,每年至少盘点一次,发生盘盈、盘亏等情况,属于正常的溢出或损耗,按照实际成本,计入管理费用。()
()是指企业在一定的生产技术组织条件下,采用科学、合理的方法,为生产单位产品或完成某项工作任务所预先规定的活劳动消耗量的限额。(2005年11月三级真题)
1810年,洪堡创办的对德国高等教育具有重要影响的大学是()。
One-thirdofParentsLackFactsaboutChildDevelopmentOne-thirdofparentsofbabieshaveasurprisinglylowknowledgeof
人们可能喜欢偶尔尝试植物性饮食,但他们真正喜欢的还是鸡肉。(flirtwith)
TheGreenhouseEffectTogetabetterunderstandingofglobalwarming,/itisimportanttounderstandthegreenhouseeffect
A、Heisalwaysontime.B、Heisatrustworthyguy.C、Heisanexperiencedpressoperator.D、Heisongoodtermswithhisworkmat
最新回复
(
0
)