S
Sammut
Hi,
I have started using the RichTextBox and got a bit stuck on the fontstyle
This is my current code
System.Drawing.Font fCurr = richTextBox1.SelectionFont;
System.Drawing.FontStyle nCurr = new FontStyle();
if (fCurr.Bold) nCurr = nCurr | FontStyle.Bold;
if (fCurr.Underline) nCurr = nCurr | FontStyle.Underline;
if (!(fCurr.Italic)) nCurr = nCurr | FontStyle.Italic;
is there any easier way to do this by getting the Current font style and add or remove what is needed
and also what does the "|" stand for and what is it's opposite if there is?
Thanks
Ivan Sammt
I have started using the RichTextBox and got a bit stuck on the fontstyle
This is my current code
System.Drawing.Font fCurr = richTextBox1.SelectionFont;
System.Drawing.FontStyle nCurr = new FontStyle();
if (fCurr.Bold) nCurr = nCurr | FontStyle.Bold;
if (fCurr.Underline) nCurr = nCurr | FontStyle.Underline;
if (!(fCurr.Italic)) nCurr = nCurr | FontStyle.Italic;
is there any easier way to do this by getting the Current font style and add or remove what is needed
and also what does the "|" stand for and what is it's opposite if there is?
Thanks
Ivan Sammt