问题 单项选择题

设有如图所示窗体和以下程序:

Private Sub Command1_Click()

Text1.Text="Visual Basic"

End Sub

Private Sub Text1_LostFoeus()

If Text1.Text<>"BASIC"Then

Text1.Text=""

Text1.SetFocus

End If

End Sub

程序运行时,在Text1文本框中输入“Basic”(如图所示),然后单击Command1按钮,则产生的结果是()。

A.文本框中无内容,焦点在文本框中

B.文本框中为“Basic”,焦点在文本框中

C.文本框中为“Basic”,焦点在按钮上

D.文本框中为“Visual Basic”,焦点在按钮上

答案

参考答案:A

解析:

题目程序的功能为,当单击命令按钮时,Text1失去焦点,激发Text1的LostFocus事件。在此事件中,程序判断文本框中字符串是否为“BASIC”,如果是则退出事件过程,继续执行命令按钮的单击事件过程,文本框中显示“Visual Basic”;如果不是则文本框内容置空,焦点返回到文本框中等待输入,不会执行命令按钮的单击事件过程。题目中输入了“Basic”,与“BASIC”不符,因此文本框置空,焦点回到文本框中。

完形填空
完形填空。
      For each of us, life is not easy. So, when something unlucky happens, remember to believe in yourself.
     When I was young, I was  1  weak in French to pass the exam. I often got "E" or "F" on my papers.
My classmates often  2  me in class. I was always sad but could do nothing. But later a French speech.
contest   3  my life. And it also changed my views on everything.
    It was a Wednesday afternoon ; my father asked me to  4  a French contest. It was a terrible idea!
My French grades were  5  bad.
    "Don't worry, dear. Believe in yourself and you' re sure to  6  the contest. " After that my father and
I chose a right topic. Then I began to  7  my best to practice it again and again over100 times. Finally I
was very  8  in the contest. When my French teacher told me I got the first prize, I could  9  believe my
ears. And my father was too  10  to say a word.
     Then everything has changed for me. When I do anything, I always believe in myself and try my best
to do it well.
( )1. A. too      
( )2. A. made faces
( )3. A. helped    
( )4. A. join      
( )5. A. sometimes
( )6. A. win      
( )7. A. take      
( )8. A. bad      
( )9. A. often    
( )10. A. excited  
B. very    
B. talked to
B. changed  
B. be in    
B. never    
B. pass    
B. try      
B. surprised
B. ever    
B. sad      
C. so          
C. laughed to  
C. took        
C. take care of
C. always      
C. beat        
C. use        
C. sorry      
C. hardly      
C. relaxed    
D. quite        
D. turned to    
D. brought      
D. take part in
D. hardly      
D. get          
D. get          
D. successful  
D. always      
D. serious      
单项选择题