How do you have a command button select all the text in a rich textbox? The command button is on a form named frmMain and the rich textbox is on a form called edit and the rich textbox itself is called editor. Thanks
Printable View
How do you have a command button select all the text in a rich textbox? The command button is on a form named frmMain and the rich textbox is on a form called edit and the rich textbox itself is called editor. Thanks
Use SelStart and SelLength, as in the example below. Make sure the HideSelection property of the RTB is set to False, or you won't see much... ;)
VB Code:
Private Sub Command_Click() frmMain.editor.SelStart = 0 frmMain.editor.SelLength = Len(frmMain.editor.TextRTF) End Sub
Works great TheVader. I have to say, you really know what your doing. Thanks man.
Please edit your original post and add [Resolved] to your Subject.