Hi,
I've noticed that you can check whether the selected font in the richtextbox is bold or italic, but not whether it is both bold and italic. Checking for bold or italic can be done likeso:
However, I cannot seem to find a way to check for both bold and italic text, as the only members of TextStyle are Bold, Italic, and Regular. Is there a way to do this?
I've noticed that you can check whether the selected font in the richtextbox is bold or italic, but not whether it is both bold and italic. Checking for bold or italic can be done likeso:
Dim
style
As
StyleDefinition = SelectedEditor.CurrentEditingStyle
Dim
fontWeight
As
TextStyle =
DirectCast
(style.GetPropertyValue(Span.FontStyleProperty), TextStyle)
btnFontBold.Checked = fontWeight = TextStyle.Bold
If
fontWeight = TextStyle.Bold
Then
btnFontBold.Checked =
True
ElseIf
fontWeight = TextStyle.Italic
Then
btnFontItalic.Checked =
True
End
If
However, I cannot seem to find a way to check for both bold and italic text, as the only members of TextStyle are Bold, Italic, and Regular. Is there a way to do this?