Tech Off Thread

3 posts

Changing the Font Stye without changing the Font Size

Back to Forum: Tech Off
  • 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.

  • User profile image
    peoples

    Ok, I feel a bit stupid now, that does work, I was editing the WRONG bit of code Sad

    DAMN that's 2 days i've been stuck on that !!

  • User profile image
    harlock123

    , peoples wrote

    Ok, I feel a bit stupid now, that does work, I was editing the WRONG bit of code Sad

    DAMN that's 2 days i've been stuck on that !!

     

    We have all been there and done that and bought the tee shirt...

    I, for one, imagine that a return trip will be made......

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.