P
Pascal
IHello
I would like to change the font size, color, name, when I click on a word
and reurn it back to its previous style if i click it again. I try this but
it works only if I make a double click on the word... When i want to select
a piece of word without an apostrophe for example it crashes: What's wrong?
Private Sub RTB_txt_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles RTB_txt.SelectionChanged
If RTB_txt.SelectionFont.Name = ("Tahoma") And _
RTB_txt.SelectionFont.Size = "12" And _
RTB_txt.SelectionFont.Style = FontStyle.Bold And _
RTB_txt.SelectionColor = System.Drawing.Color.Red Then
RTB_txt.SelectionFont = New Font("Arial", 11, FontStyle.Regular)
RTB_txt.SelectionColor = System.Drawing.Color.Black
Else
RTB_txt.SelectionFont = New Font("Tahoma", 12, FontStyle.Bold)
RTB_txt.SelectionColor = System.Drawing.Color.Red
RTB_txt.AutoWordSelection = True
End If
End Sub
thanks
pascal
I would like to change the font size, color, name, when I click on a word
and reurn it back to its previous style if i click it again. I try this but
it works only if I make a double click on the word... When i want to select
a piece of word without an apostrophe for example it crashes: What's wrong?
Private Sub RTB_txt_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles RTB_txt.SelectionChanged
If RTB_txt.SelectionFont.Name = ("Tahoma") And _
RTB_txt.SelectionFont.Size = "12" And _
RTB_txt.SelectionFont.Style = FontStyle.Bold And _
RTB_txt.SelectionColor = System.Drawing.Color.Red Then
RTB_txt.SelectionFont = New Font("Arial", 11, FontStyle.Regular)
RTB_txt.SelectionColor = System.Drawing.Color.Black
Else
RTB_txt.SelectionFont = New Font("Tahoma", 12, FontStyle.Bold)
RTB_txt.SelectionColor = System.Drawing.Color.Red
RTB_txt.AutoWordSelection = True
End If
End Sub
thanks
pascal