Rich Text Formatting Help

How do I create rich text formating buttons like centering text and making it bold/italic/underlined, also changing the font, font size and font colour Please help.

Answer this question

Rich Text Formatting Help

  • Davids Learning

    With Fontdlg

    .ShowDialog()

    ' Apply the settings in the

    ' Font Dialog Box to the selected text

    rtfCode.SelectionColor = .Color

    rtfCode.SelectionFont = .Font

    End With

    MyRTF.SelectionAlignment = HorizontalAlignment.Center



  • bkohler

    Yes, I had forgotten about the errors. But, all in all, it is a pretty nice extended control.

    Glad I could help.

    james

    aka:Trucker


  • Matt Nunn

    I need to know how to WYSIWYG print from a rich text box as well. Please help!
  • Shete

    Follow this link and follow the instructions there.

    http://support.microsoft.com/default.aspx scid=kb;en-us;811401

    Basicly, what you will be doing is creating an extended RichTextBox control with printing features. If you follow the instructions exactly as stated, it will work. I have used this code and it works quite well. Hope this helps.

    james

    aka:Trucker


  • MCFH

    Now, can you tell me how to print whats in a rich text box
  • HermanMoore

    Thanks, I have been looking forever for that!!!

    I did find a couple of errors in this though:

    First:

    7. Copy the following code to RichTextBoxPrintCtrl.vb

    I had to add "Option Strict off" to the top to get it to build.

    Second:

    11. Add the following code to Class Form1:

    Has and error of: btnPageSetup.Click.Click

    the second click is obviously in error.

    I wanted to point that out so it could either get fixed, or it might help out others.

    Thanks for your help again!


  • Rich Text Formatting Help