When we conducting data entry, maybe we want when this control got focus existing text at the control have been Selected all. with this tips we nededn't ahead vanishing which have text. we can making function for this matter like this

code:
------------Cut Here-----------------------

Public Sub SelectAll(EditCtr As Control)
with EditCtr
.SelStart = 0
.SelLength = Len(EditCtr.Text)
.SetFocus
End With
End Sub

Usage sample:

Write at GotFocus event on input control:

call SelectAll

------------Finish--------------------------

0 komentar