A: Click Project, Components, and Select Microsoft Rich TextBox from the list
Q: How Do Align Text In A RichTextBox?
A: The Following Will Align The Text In The Center. Left And Right Are Similar :
Code:
Private Sub cmdCenter_Click()
'Center Align
rtfText.SelAlignment = rtfCenter
End Sub
Q: How Do I Format The Text, Bold, Italic Or Underline?
A: The Next Segment Will Bold, Italicise, Underline Text :
Code:
Private Sub cmdBold_Click()
'Bold
rtfText.SelBold = Not rtfText.SelBold
End Sub
Private Sub cmdItalic_Click()
'Italic
rtfText.SelItalic = Not rtfText.SelItalic
End Sub
Private Sub cmdUnderline_Click()
'Underline
rtfText.SelUnderline = Not rtfText.SelUnderline
End Sub
Q: How Do I Change The Text Colour?
A: The Next Segment Shows How To Change A Color, With The Use Of The CommonDialog Component, Which Must Be Added By Clicking Project, Components, And Selecting It From The Available List.
Code:
Private Sub cmdColor_Click()
'CommonDialog To Show Colours
CD.Flags = cdlCFBoth 'Show All Colours
CD.ShowColor
rtfText.SelColor = CD.Color 'Set Colour
End Sub
A Full Example Of The RTB In Working Is Attached
Last edited by HanneSThEGreaT; May 12th, 2010 at 08:15 AM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.