单选题
VB
2009-04-18
在窗体上画一个文本框(其名称为Textl)和一个标签(其名称为Labell)。要求程序运行后,如果在文本框中输入字符,则立即在标签中显示相同的内容。以下可以实现上述操作的事件过程是:( )
A.Private Sub Text1_Change()
Label 1.Caption=Text1.Text
End Sub
Label 1.Caption=Text1.Text
End Sub
B.Private Sub Text1_Click()
Label 1.Caption=Text1.Text
End Sub
Label 1.Caption=Text1.Text
End Sub
C.Private Sub Labell_Change()
Label 1.Caption=Text 1.Text
End Sub
Label 1.Caption=Text 1.Text
End Sub
D.Private Sub Label1_Click()
Label 1.Caption=Text 1.Text
End Sub
Label 1.Caption=Text 1.Text
End Sub
参考答案
A
答案解析
用户每改变一次文本框中的内容,将触发一次Change事件。为了实现题目所述功能,只需在文本框的Change事件过程中将文本框的文本(Text属性值)传递给标签的标题(Caption属性值)即可。所以,答案是A。

