问题 问答题

注意:下面出现的“夹”均为c:\wexam\25160001。
请根据以下各小题的要求设计Visual Basic应用程序(包括界面和代码)。
(1)在名称为Form1的窗体上画两个文本框,名称分别为T1和T2,初始情况下都没有内容。请编写适当的事件过程,使得运行时,在T1中输入的任何字符,立即显示在T2中,如图10-1所示。程序中不得使用任何变量。
注意:存盘时必须存放在考生文件夹下,工程文件名为sjt1.vbp,窗体文件名为sjt1.frm。
(2)在名称为Form1的窗体上画一个文本框,名称为Text1;再画一个命令按钮,名称为C1,标题为“移动”,如图10-2所示。请编写适当的事件过程,使得在运行时,单击“移动”按钮,则文本框水平移动到窗体的最左端如图10-3所示。程序中不得使用任何变量。
注意:存盘时必须存放在考生文件夹下,工程文件名为sjt2.vbp,窗体文件名为sjt2.frm。

答案

参考答案: 在窗体上建立好控件后,先设置控件属性,再编写事件过程。
文本框的文本内容由Text属性设置。题目要求在T1中输入任何字符时,立即在T2中显示,这要用到文本框的Change事件。当用户向文本框中输入新信息,或当程序把Text属性设置为新值从而改变文本框的Text属性,将触发Change事件。
解题步骤:
第一步:建立界面并设置控件属性。程序用到的控件及其属性见表10-1。


第二步:编写程序代码。
参考代码:
Private Sub T1_Change()
T2.Text=T1.Text
End Sub
第三步:调试并运行程序。
第四步:按题目要求存盘。
(2) 在窗体上建立好控件后,先设置控件属性,再编写事件过程。
本题考查的是控件的位置改变,控件的位置由控件的Left属性和Top属性决定,Left属性表示控件与所在窗体的左边之间的距离,Top属性表示控件与所在窗体的顶边之间的距离。题目要求将文本框移到窗体的最左边,即Text1.Left=0。解题步骤:
第一步:建立界面并设置控件属性。程序用到的控件及其属性见表10-2。


第二步:编写程序代码。
参考代码:
Private Sub C1_Click()
Text1.Left=0
End Sub
第三步:调试并运行程序。
第四步:按题目要求存盘。
答案考生文件夹

单项选择题
单项选择题

Lichens may grow on the bark of a tree in a steaming tropical rain forest, on the bricks of big city buildings, on rocks in hot springs, on wind-swept mountaintops, and in the driest desserts. In the arctic, they provide the principal food for caribou, and they are one of the few plants that grow in Antarctica. They are pioneers, appearing in barren rocky areas and starting the formation of soil in which mosses, then ferns, and then other plants can take root.
Lichens are a partnership of two plants — fungi and algae. The lichen body is made up of a network of fungal strands. In the upper layers of these grow groups of algae. The two organisms live together to the benefit of both, a relationship known as symbiosis. The fungi provide support, absorb water, and shelter the tender algae from direct sunlight. The algae carry on photosynthesis and provide the fungi with food. The algae can live independently and are recognizable as a species that grows alone. The fungi, on the other hand, cannot live apart from their partners. They can be placed in known classes of fungi but are unlike any species that lives independently.
So definite are the form, color, and characteristics of these double organisms that for hundreds of years, they were classified as one. More than 15,000 "species" were named. If these organisms are classified as separate species, it is difficult to fit them into the existing system of classification. But if they are classified separately, these species of fungi seem rather strange. Lichens are a splendid example of the difficulties faced by taxonomists in classifying species.

Why does the author say that "these species of fungi seem rather strange"

A.They are larger than typical fungi.

B.Unlike other fungi, they can produce their own food.

C.They exist only as partners of algae.

D.They do not fit into any known class of fungi.