Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow User To Size In Text Box 1

Status
Not open for further replies.

TripleJHJO

Programmer
Jan 10, 2003
76
US
I have a Rich Text Box where users enter in address information to create a label. I would like the user to be able to control the size/type of their font as well as color and boldness. Is there an ActiveX control that will allow a user to do these things.
If I had to program these options, I think it would take more time than it was worth.
Any suggestions would be most helpful.

Thanks,
J.Jensen
 
Is there some sample code/examples that you can recommend so that I can review it?

Thanks.
 
You'll need a form with a richtextbox and two command buttons for this simple example:
Code:
[blue]Option Explicit

Private Sub Command1_Click()
    CommonDialog1.Flags = cdlCFBoth
    CommonDialog1.ShowFont
    RichTextBox1.SelFontSize = CommonDialog1.FontSize
    RichTextBox1.SelFontName = CommonDialog1.FontName
    RichTextBox1.SelBold = CommonDialog1.FontBold
    RichTextBox1.SelItalic = CommonDialog1.FontItalic
    RichTextBox1.SelUnderline = CommonDialog1.FontUnderline
    RichTextBox1.SetFocus
End Sub

Private Sub Command2_Click()
    CommonDialog1.Flags = cdlCCFullOpen
    CommonDialog1.ShowColor
    RichTextBox1.SelColor = CommonDialog1.Color
    RichTextBox1.SetFocus
End Sub

Private Sub Form_Load()
    Command1.Caption = "Font"
    Command2.Caption = "Colour"
End Sub
[/blue]

 
Strongm,
Thank you very much for the example. It cleared things up beautifully for me.
I would like to take it one step further if you don't mind:

How can I print this rich text box in it's displayed format to a printer?

Thanks again,
J.Jensen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top