top
Loading...
自動選擇Text的內容

在使用 VFP 的應用進行錄入時,每進入一個錄入框,就自動選擇該框中的所有內容。利用以下的代碼,也可實現類似的功能。
Private Sub MyTextBox_GotFocus()
AutoSelect MyTextBox
End Sub

Sub AutoSelect(SelObject As Control)
SelObject.SelStart = 0
If TypeOf SelObject Is MaskEdBox Then
SelObject.SelLength = Len(SelObject.FormattedText)
Else
If TypeOf SelObject Is TextBox Then
SelObject.SelLength = Len(SelObject.Text)
End If
End If
End Sub

本文出自天涯風鈴

作者:http://www.zhujiangroad.com
來源:http://www.zhujiangroad.com
北斗有巢氏 有巢氏北斗