Tech Off Post

Single Post Permalink

View Thread: Changing the Font Stye without changing the Font Size
  • User profile image
    peoples

    Hi I have a Rich Text Box in VB, I want to select text and change the font style (bold/underline etc) but each time I do this i have to declare a new font and so it changes the font size also. Even if I get the current font size and use it as a variable.

     

    CurrentFontSize = Me.RichTextBox1.SelectionFont.Size

    RichTextBox1.SelectionFont = NewFont("Comic Sans MS", CurrentFontSize, FontStyle.Bold)

    Can u help with this, is there a way just to underline or strikeout text without havin the declare a new font ?

     

    Gregor.