问题 问答题

完成下列问题:

在考生文件夹下有一个工程文件sjt3.vbp。窗体上有名称为Timer1的定时器,以及名称为Line1和Line2的两条水平直线。
请用名称为Shape1的形状控件,在两条直线之间画一个宽和高都相等的形状,其显示形式为圆,并设置适当属性使其满足以下要求:
①圆的顶端距离窗体Form1顶端的距离为360。
②圆的颜色为红色(红色对应的值为:&H000000FF&或&HFF&),如图3所示。
[*]
程序运行时,Shape1将在Line1和Lihe2之间运动。当Shape1的顶端到达Line1时,会自动改变方向而向下运行;当Shape1的底部到达Line2时,会改变方向而向上运动。
文件中给出的程序不完整,请在程序中的横线处填写正确的内容,使其实现上述功能。
注意:不能修改程序的其他部分和已给出的控件的属性,最后把修改后的文件按原文件名存盘。
[题目提供的源程序]
Dim s As Integer, h As Long
Private Sub Form_Load( )
Timer1.Enabled= (1)
s=-40
End Sub
Private Sub Timer1_Timer()
Shape1.Move Shape1.Left, Shape1.Top+s
If Shape1.Top<= (2) Then
s=-s
End If
If Shapp1.Top+ (3) >=Line2.Y1 Then
s=-s
End If
End Sub

答案

参考答案:[操作步骤]
第1步:添加形状控件。打开工程sjt3.vbp,进入窗体设计状态。单击工具箱中的形状按钮

,在窗体上画一个形状控件,保持默认名称Shape1不变,修改Height和Width属性使这两个属性值大小相等。修改其Shape属性为3-Circle,修改其FillStyle属性为0-Solid,将其FillColor和BorderColor属性都设置为&H000000FF&,再修改其Top属性值为360。
第2步:修改代码。
第3步:调试、运行并保存程序。
[1]True [2]Line1.Y1 [3]Shape1.Height

解析: 在窗体的载入事件中启动计时器Timer1,在Trimer1的Timer事件中通过形状控件的Move方法移动形状,移动时只改变了Y轴方向的值,即可实现形状的上下移动。通过对Shape1.Top的值和Line1.Y1的值的比较来判定圆形是否越过上界,通过对Shape1.Top+Shape1.Height的值和Line2.Y1的值的比较来判定圆形是否越过下界。

阅读理解
阅读理解。
     根据短文内容,从短文后的选项中选出能填入空白处的最佳选项。选项中有两项为
多余选项。
                                                  Making Peace with Your Parents
     As a teen, you're going through big changes physically and mentally. Your interests are expanding.  
  1  
     Here is the challenge: Kids need to explore the world in new ways, and parents need to protect them
from the dangers in that world. These conflicts can easily set off fireworks in otherwise calm houses.
Sometimes conflicts can't be avoided. But by paying attention to the building blocks of successful
relationships, you can work towards making home a happy and healthy place for you and your parents.
     For instance, try to find a time to talk when your parents are not angry, tired, distracted or hungry.
A good time to talk is when you're all relaxed. Timing is everything. If the conversation begins to turn into
an argument, you'd better calmly and coolly ask to stop the conversation-for now.     2    Listen  to  
what  your parents are saying, and repeat it back to them. This shows them that you're listening.     3  
     Respect is the building block of good communication. People who respect each other and care about
each others' feelings can disagree without things getting ugly.
        4   How do you build trust? Trust comes by actually doing what you say you're going to do. Some
teens find that doing fun activities with their parents can improve their relationships. Sometimes we forget
that parents are more than rulemakers-they're interesting people who like to watch movies and go
shopping-just like their teenagers!
     What do you do if you are trying your best, but your relationship with your parents continues to be
rocky?    5    You can find supportive adults, such as a teacher or a coach, who can lend an ear.
Remember you can only change your own behavior. Your parents are the only ones who can change
theirs.
A. It also gives them a chance to clear things up if    you're not on the same page.
B. You can pick it up again when everyone's more relaxed.
C. And then you'll be able to accept what your parents say.
D. Faced with the challenge, children don't know what to do.
E. You are more likely to get along with your parents and have more independence if
      your parents believe    in you.
F. And your desire to take control of your own life is growing.
G. You may consider seeking outside help
单项选择题