1.11M Members

Changing color of selected text in a RichTextBox?

 
0
 

Hello all,

I'm taking my first BASIC programming class this year, and for a final project, I'm trying to make a book-keeping log.

What I want to have happen, is to open a list of books, highlight a book title, click the "check in" button and have the text change to green, or red if the "check out" button is clicked, but I'm having problems trying to change the color of the text.

If anyone could explain how to do so, it would be greatly appreciated.
Thanks in advance!

 
0
 

Use the SelColor method.
Example code:

Private Sub cmdCheckIn_Click()
Me.RichTextBox1.SelColor = vbRed
End Sub

A further explanation (and example) is in the VB help file. Wonderful thing, that help file. You should browse it some time just for some interesting insights.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: