How To Set Effects Of Selected Text?

By Goniey N (Mr. G)

You Can Set The Bold Or Italic Or Underline Or Strikeout Effects Of Your Selected text...

'For That You Have To Take Richtextbox, because These Effects Can Display In The RichTextBox Not In The Normal TextBox....


'For Bold Effect :

Dim fnt As New Font(RichTextBox1.Font, FontStyle.Bold)
RichTextBox1.SelectionFont = fnt


'For Italic Effect :

Dim fnt As New Font(RichTextBox1.Font, FontStyle.Italic)
RichTextBox1.SelectionFont = fnt

'For Underline Effect :

Dim fnt As New Font(RichTextBox1.Font, FontStyle.Underline)
RichTextBox1.SelectionFont = fnt

'For Strikeout Effect :

Dim fnt As New Font(RichTextBox1.Font, FontStyle.Strikeout)
RichTextBox1.SelectionFont = fnt


'For Regular(Without Any Effect) :

Dim fnt As New Font(RichTextBox1.Font, FontStyle.Regular)
RichTextBox1.SelectionFont = fnt

How To Set Effects Of Selected Text?  (793 Views)