jonpyne
Newcomer
rtbPad.SelBold = Not rtbPad.SelBold
Okay, one last try before I give up ...
Hi, all !
Would appreciate a kindly shoulder, if anyone has a moment.
A hypothetical text editor, using a RichTextBox control has a menu/toolbar [whatever] with a _bold_ item that can be toggled on/off, just like in MS Word/WordPad.
In VB6, you would have stuck the code in my subject behind it, but this does not work any more, as MS has made the SelectionFont.Bold property read-only and introduced Font objects.
Dunno if this helps, but I was working along the following lines ...
Anyone feel like giving me a hand ? This must be a pretty common issue, I just haven't got my head round VB .NET yet.
Just in case, I do not want to use FontStyle.Regular, as this would remove other formatting. Nor do I wish to use a FontDialog. I am just looking to get my toggle back ...
thanks
jON
Okay, one last try before I give up ...
Hi, all !
Would appreciate a kindly shoulder, if anyone has a moment.
A hypothetical text editor, using a RichTextBox control has a menu/toolbar [whatever] with a _bold_ item that can be toggled on/off, just like in MS Word/WordPad.
In VB6, you would have stuck the code in my subject behind it, but this does not work any more, as MS has made the SelectionFont.Bold property read-only and introduced Font objects.
Dunno if this helps, but I was working along the following lines ...
Code:
Dim x As Font = rtbPad.SelectionFont
Dim y As FontStyle = x.Italic Or x.Strikeout Or x.Underline
If x.Bold Then
rtbPad.SelectionFont = New Font(x, y)
Else
rtbPad.SelectionFont = New Font(x, y Or FontStyle.Bold)
End If
Anyone feel like giving me a hand ? This must be a pretty common issue, I just haven't got my head round VB .NET yet.
Just in case, I do not want to use FontStyle.Regular, as this would remove other formatting. Nor do I wish to use a FontDialog. I am just looking to get my toggle back ...
thanks
jON