gchq
Well-known member
- Joined
- Dec 14, 2007
- Messages
- 168
- Programming Experience
- 10+
Hi there
I have an RTB and several buttons that change the formatting like this:-
I'm trying to find an event within the RTB that I can use to change the buttons from on to off depending upon the .SelectionFont properties at the cursor point..
Any ideas?
Thanks
I have an RTB and several buttons that change the formatting like this:-
VB.NET:
Private Sub SwitchBold(ByVal sender As Object, ByVal e As EventArgs)
Dim vBold As ToolStripButton = CType(sender, ToolStripButton)
With EditorRTB
If .SelectionFont IsNot Nothing Then
Dim CurrentFont As Drawing.Font = .SelectionFont
Dim NewFont As Drawing.FontStyle
If .SelectionFont.Bold = True Then
NewFont = CurrentFont.Style - Drawing.FontStyle.Bold
With vBold
.Image = My.Resources.Bold_Off
.ToolTipText = "Bold formatting set to off"
End With
Else
NewFont = CurrentFont.Style + Drawing.FontStyle.Bold
With vBold
.Image = My.Resources.Bold_On
.ToolTipText = "Bold formatting set to on"
End With
End If
.SelectionFont = New Drawing.Font(CurrentFont.FontFamily, CurrentFont.Size, NewFont)
End If
End With
End Sub
I'm trying to find an event within the RTB that I can use to change the buttons from on to off depending upon the .SelectionFont properties at the cursor point..
Any ideas?
Thanks