I want change font style in RichTextBox sp. I working in WPF.
sp.FontStyle = FontStyle.Bold;
Error say: System.Windows.FontStyle' does not contain a definition for 'Bold'
I don't know, how to change, if this start working.
I want change font style in RichTextBox sp. I working in WPF.
sp.FontStyle = FontStyle.Bold;
Error say: System.Windows.FontStyle' does not contain a definition for 'Bold'
I don't know, how to change, if this start working.
You need to set Bold in FontWeight-property:
sp.FontWeight = FontWeights.Bold;
Same in WinForms:
sp.Font = new Font(sp.Font.Name, sp.Font.Size, FontStyle.Bold);