17-10-12, 12:32 AM
كاتب الموضوع : AhmedEssawy
الدالة التي تقوم بعملية التحديدكود :
Public Sub AutoSelectText(EditControl As Object)
'Defining edit control as object
'lets you do this with any control that
'supports SelStart and SelLength
On Error GoTo ErrorHandler
Dim lTextLength As Long
lTextLength = Len(EditControl.Text)
If lTextLength Then
EditControl.SelStart = 0
EditControl.SelLength = lTextLength
End If
ErrorHandler:
Exit Sub
End Sub
كود :
Private Sub Text1_GotFocus()
AutoSelectText Text1
End Sub