[RESOLVED] [2005] 1 format toolbar and 2 richtextboxes...
My form has 2 richtextboxes on it and I have one toolbar with formatting buttons on the main mdi form, there won't be multiple instances of the child form.
I'm trying to make it so when a RTF box gets focus, it sets a variable like this:
RTFObject = ActiveRTF
RTFObject being the variable and ActiveRTF the RTF box that just got focus. So when I press one of the format buttons, it works like:
RTFOBject.SelectionFont = New Font(RTFOBject.SelectionFont, (RTFOBjectSelectionFont.Style Or FontStyle.Bold))
My overall goal is to have just one format toolbar and when focus is given to either of the 2 richtextboxes, it will format the right box.
Any ideas?
Re: [2005] 1 format toolbar and 2 richtextboxes...
Nevermind, my problem was I decalred RTFObject on the main form when I should of made it on the actual RTF form.
Public RTFObject As RichTextBox
RTFObject = ActiveRTF
And on the main form, for the bold button:
formSoftware.RTFObject.SelectionFont = New Font(formSoftware.RTFObject.SelectionFont, FontStyle.Bold)