问题 填空题

把窗体的KeyPreview属性设置为True,并编写如下两个事件过程: Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Print KeyCode; End Sub Private Sub Form_KeyPress(KeyAscii As Integer) Print KeyAscii End Sub 程序运行后,如果按下A键,则在窗体上输出的数值为 【11】 【12】

答案

参考答案:[11]65

解析:[12]97[评析] 按下和松开一个ANSI键时发生KeyPress事件,其语法为: Private Sub object_KeyPress([index As Integer,]keyascii As Integer) KeyPreview属性,返回或设置一个值,以决定是否在控件的键盘事件之前激活窗体的键盘事件。键盘事件为: KeyDown、KeyUp和KeyPress。当KeyPreview的值为。True时窗体先接收键盘事件,然后是活动控件接收事件;为False时(缺省值)活动控件接收键盘事件,而窗体不接收。 KeyPress将每个字符的大、小写形式作为不同的键代码解释,即作为两种不同的字符。而KeyDown和KeyUp用两种参数解释每个字符的大写形式和小写形式:KeyCode——显示物理的键(将A和a作为同一个键返回)和Shift——指Shift+Key键的状态而且返回A或a其中之一。 本题中,由于Form的KeyPreview属性为True,窗体能够接受到键盘事件。当A键按下时,KeyDown事件产生,此时KeyCode=65。A键松开后,KeyPress事件产生,此时KeyAscii=97。

单项选择题
阅读理解

阅读理解

      Stop wasting your time thinking of reasons for your failures and shortcomings.Instead, realize that the

seeds of success were planted within you when you were born.Only you have the power to make those

seeds grow.

      The seeds and the power to grow them are contained in the human mind.Success is a choice but not

a chance.You can be a success if only you make the right choice.

      You cannot be successful without first developing yourselfesteem (自尊). Your level of selfesteem is

always based on the degree of control that you are able to exercise over yourself, and thus over your life.

People with low selfesteem do not believe that they have any power, or responsibility for their lives.They

are leaves tossed (摇摆) by the winds of chance brought about with any sudden change in the weather.

      You can exercise control over your life only to the degree that you believe that you are responsible

for whatever happens in your life.Failures think that everything happens by accident while successful

people realize that they are responsible.

      Everything happens as a result of something.If we can identify the cause, we can control the effect.

We are responsible for what we consciously choose to accept and believe.Thoughts and beliefs cause

everything.Our attitudes and actions are a result of habits ingrained in us over a period of time.One

generally rises to the level that one expects.We are responsible for setting our expectations.Our success

depends upon our level of confidence.We are responsible for either reinforcing good habits or kicking

bad habits and consciously replacing them with consistently practiced good habits.

      If you associate with positivethinking people, you are definitely going to achieve success.On the

contrary, the opposite happens.We are responsible for finding, planting, and nurturing (培育) the seeds

that contain future victory, born from setbacks.

      In short, in all areas of your life, whether they are financial, physical, emotional, or spiritual, you are

responsible.Once you recognize this, accept it, and firmly believe it, you are on the road to success.

1. Losers would think that________.

A. success is the result of hard work

B. working hard will lead to success

C. they fail only because of bad luck

D. they don't make efforts to succeed

2. It can be inferred from Paragraph 5 that________.

A. whether we will succeed depends on our attitudes

B. developing confidence is the key to future success

C. thoughts and beliefs are the result of creative mind

D. setting our expectations is essential before taking action

3. The last paragraph serves as________.

A. the proof of the author's point

B. the conclusion of the argument

C. an introduction to another topic

D. a comparison between two views

4. Which is the best title of the text?

A. Success is a choice

B. The secrets of success

C. Develop our confidence  

D. How to achieve success