Well... Of course. The
Bold
or
Italic
FontStyle
is applied to both
RichTextBox
es because you wrote the code to change it for both in the same
event
handler.
Why did you expect the compiler to know which
RichTextBox
you want to be affected when you specified both of them??
By the way (not related to your question):
You should really write
if (!string.IsNullOrEmpty(rtbQuestion.SelectedText))
{
}
instead of
if (rtbQuestion.SelectedText != null && rtbQuestion.SelectedText != "")
{
}