I have performance issues in this code segment which I think is caused by the "new Font".
Will it be faster if fonts are static/global ?
if (row.StartsWith(TILD_BEGIN))
{
rtbTrace.SelectionColor = Color.Maroon;
rtbTrace.SelectionFont = new Font(myFont, (float)8.25, FontStyle.Regular);
if (row.StartsWith(BEGIN) )
rtbTrace.AppendText(Environment.NewLine + row + Environment.NewLine);
else
rtbTrace.AppendText(Environment.NewLine + row.Substring(1)
+ Environment.NewLine);
continue;
}
if (row.StartsWith(EXCL_BEGIN))
{
-- similar block
}
if (row.StartsWith(DLR_BEGIN))
{
-- similar block
}
.
.
.