I have a form on which I have several RichTextBoxes. Now, I'd like to be able to set text to Bold or Italics in each of these RichTextBoxes. On a given form like the following, we have these elements:
FormMain
CommandButtonBold
CommandButtonItalics
RichTextBox1
RichTextBox2
RichTextBox3
RichTextBox4
If we select (=highlight) some text in one of these RichTextBoxes and press one of the above Command Buttons, how can we determine which RichTextBox should be the target of this formatting? For example, we select (=highlight) some text in RichTextBox1 and then, we press CommandButtonBold to set the selected text to Bold. How can we know that the selected text in RichTextBox1 needs to be formatted? When another control gets focused, all the RichTextBoxes will lose focus.
When you select some text in a RichTextBox, it is the Active Control at that time. But if you press a Control that receives focus, the RichTextBox loses focus and another control will become the Active Control.
We can determine which control is Active at a given time using this command:
Expand|Select|Wrap|Line Numbers
- Screen.ActiveControl
But I don't know how to handle this problem.
Any help regarding this problem will be appreciated.