-
I have a ricktext box, and a combobox. The combobox is for changing the color of selected text within the richtextbox.
The problem is, I select the text I want to change the color of, but when I drop down the combobox, the Richtextbox loses focus and the text is deselected, is there a way to prevent this??
-
Private Sub combo1_Click()
RichTextBox1.SetFocus
End Sub
Private Sub combo1_Change()
RichTextBox1.SetFocus
End Sub
When you select the color, the RichTextBox will have the focus once again.
-
ok, but...
Does the selected text become unselected? if so, that whole process is pointless
-
Add this code to your form code to keep the text selected:
Code:
Private Sub RichTextBox1_GotFocus()
RichTextBox1.HideSelection = False
End Sub
[Edited by dsy5 on 09-30-2000 at 07:12 PM]
-
Sorry, code in the above post will not keep the text selected when you replace it. I'll keep trying to find a solution.