Well, .... in YOUR program, you would have this code:
That is done quite simply in my DLL by doing this:VB Code:
Private Sub txtHighlight_GotFocus() Call CC.HighlightEntireSelection(txtHighlight) End Sub
See. Nothing special. Just code that well all understand. I just packaged it all up into a really easy to use DLL. It's made all my projects smaller.VB Code:
Public Sub HighlightEntireSelection(ByRef objTextArea As Object) 'Highlights the entire selection On Error Resume Next If TypeOf objTextArea Is ComboBox Or TypeOf objTextArea Is TextBox Then objTextArea.SelStart = 0 objTextArea.SelLength = Len(objTextArea.Text) End If End Sub




Reply With Quote