在运行阶段,要在文本框Text1获得焦点时选中文本框中所有内容,对应的事件过程是

admin2010-11-20  31

问题 在运行阶段,要在文本框Text1获得焦点时选中文本框中所有内容,对应的事件过程是

选项 A、Private Sub Text1_GotFocus()
Text1.SelStart=0
Text1.SelLength=Len(Text1.Text)
End Sub

B、Private Sub Text1_LostFocus()
Text1.SelStart=0
Text1.SelLength=Len(Text1.Text)
End Sub

C、Private Sub Text1_Change()
Text1.SelStart=0
Text1.SelLength=Len(Text1.Text)
End Sub

D、Private Sub Text1_SetFocus()
Text.SelStart=0
Text1.SelLength=Len(Text1.Text)
End Sub


答案A

解析 GotFocus事件过程用以指定当控件或窗体首次接收焦点时发生的操作。属性:SelStart——返回或设置所选择的文本的起始点。如果没有文本被选中,则指出插入点的位置;SelLength——返回或设置所选择的字符数。
转载请注明原文地址:https://kaotiyun.com/show/1Omp777K
0

最新回复(0)