Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

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......

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.