Q: How Do I Add A Rich TextBox To My Application?
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 :
Q: How Do I Format The Text, Bold, Italic Or Underline?Code:Private Sub cmdCenter_Click() 'Center Align rtfText.SelAlignment = rtfCenter End Sub
A: The Next Segment Will Bold, Italicise, Underline Text :
Q: How Do I Change The Text Colour?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
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.
A Full Example Of The RTB In Working Is AttachedCode:Private Sub cmdColor_Click() 'CommonDialog To Show Colours CD.Flags = cdlCFBoth 'Show All Colours CD.ShowColor rtfText.SelColor = CD.Color 'Set Colour End Sub


Reply With Quote
Bookmarks