Answer the question
In order to leave comments, you need to log in
Why is text not bold in RichTextBox?
public static void AddLineAndBlob(ref RichTextBox textBox, KeyValuePair<string, double[]> item, string[] blob)
{
textBox.Text += item.Key + " ";
int selectIndex = textBox.Text.Length;
for (int i = 0; i < item.Value.Length; i++)
{
if (Array.IndexOf(blob, item.Value[i].ToString()) == -1)
{
textBox.Text += item.Value[i].ToString() + " ";
selectIndex += textBox.Text.Length;
}
else
{
textBox.Text += item.Value[i].ToString() + " ";
textBox.Select(selectIndex, item.Value[i].ToString().Length);
textBox.SelectionFont = new Font(textBox.Font, FontStyle.Bold);
selectIndex += textBox.Text.Length;
}
}
textBox.Text += "\n";
}
Answer the question
In order to leave comments, you need to log in
after changing .Text you can forget about formatting
. I suggest checking this statement.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question