问题 问答题

在考生文件夹下有工程文件djks030.vbp及窗体文件djks030.frm。根据下文的描述,编写相应的程序。存盘时不得改变文件名和文件夹。

本题描述如下:在窗体上有一个名为Image1的图像框,要求程序运行后,每用鼠标左键点击图像框一次,则图像框的高与宽都增加300;每用鼠标右键点击图像框一次,图像框的高与宽都减小300。窗体的高与宽为3500,图像框最大化时不允许超过窗体的大小,最小化时图像框的高与宽不小于500(高与宽的单位为twip)。

程序运行时的窗口界面如下图所示。

答案

参考答案:

第一步:启动VB,打开考生文件夹下的工程文件sjt3.vbp。

第二步:双击窗体中的任何位置,进入代码编辑窗口,填写代码如下:

1 Private Sub Image1_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)

2 If Button=1 Then

3 If Image1.Height<3500 Or Image1.Width<3500 Then

4 Image1.Height=Image1.Height+300

5 Image1.Width=Image1.Width+300

6 End If

7 End If

8 If Button=2 Then

9 If Image1.Height>500 Or Image1.Width>500 Then

10 Image1.Height=Image1.Height-300

11 Image1.Width=Image1 Width-300

12 End If

13 End If

14 End Sub

第三步:填写完毕,调试成功后,以原文件名保存。

解析:

根据题意,本题可以使用MouseUp事件也可以使用MouseDown事件。“Button=1”表示按下鼠标左键,“Button=2”表示按下鼠标右键。“Image1.Height<3500 Or Image1.Width<3500”表示条件Image1.Height<3500与条件Image1.Width<3500只要任一为True时就执行Then后面的语句。下面的程序代码与此类似。

单项选择题 共用题干题
完形填空
通读下面短文,掌握其大意,然后在各题所给的A,B,C,D四个选项中,选出一个最佳答案。
I was in the queue for the supermarket checkout(付款台) earlier today.All of the checkouts were    36  , and the woman behind me was not happy! Every word that came from her mouth was a(n)    37  ! She wasn’t happy with the number of checkouts      38   ; she wasn’t happy with the amount of shopping some people had in their baskets; she wasn’t happy because this supermarket didn’t have a stand where she    39   scan her own shopping.
I listened to her    40  looking around as I loaded my stuff onto the conveyor belt (传送带).I didn’t want    41   to do with that kind of attitude, and if ever I’d felt like letting someone go     42    of me, it wouldn’t be such a woman!
But then I    43  back.Standing beside the woman was a five-year-old girl,    44   her granddaughter.The girl’s part of the shopping    45  of some comic books.
I couldn’t    46  it.I pushed my shopping back to the end of the conveyor belt,     47   a space.“After you,” I said to the woman and the girl, and    48   them to a big    49   .The woman was delighted, and even    50   to complain ---- until she was walking away.
So,  51  bother having helped? It was because that little girl was probably taking in her granny’s complaint like a sponge(海绵).She was learning how to    52   situations like that by listening to her granny.I’d seen that I could interrupt that complaining, and put a smile and some   53   into the middle of it.
We can all complain; we can all react    54   , but it doesn’t have to be like that.And, even if only for a few     55    , I wanted to leave that little soul with just a glimpse of another way.
小题1:
A.busyB.big C.freeD.empty
小题2:
A.quarrel B.argumentC.praiseD.complaint
小题3:
A.opened B.closedC.leftD.hired
小题4:
A.wouldB.needC.couldD.must
小题5:
A.beyondB.withoutC.withD.by
小题6:
A.somethingB.nothingC.everythingD.anything
小题7:
A.aheadB.behindC.besideD.back
小题8:
A.wentB.glancedC.focusedD.jumped
小题9:
A.merelyB.surelyC.possiblyD.luckily
小题10:
A.containedB.includedC.consistedD.made
小题11:
A.thinkB.helpC.believeD.forget
小题12:
A.takingB.leavingC.bringingD.occupying
小题13:
A.returnedB.pleasedC.treatedD.served
小题14:
A.smileB.mealC.jokeD.room
小题15:
A.thankedB.paidC.checkedD.forgot
小题16:
A.howB.whatC.whyD.who
小题17:
A.face withB.put withC.deal withD.do with
小题18:
A.truthB.kindnessC.courageD.money
小题19:
A.actively B.correctlyC.negativelyD.patiently
小题20:
A.hoursB.chancesC.yearsD.seconds