We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,901 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Changing color of selected text in a RichTextBox?

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!

2
Contributors
1
Reply
59 Minutes
Discussion Span
1 Year Ago
Last Updated
2
Views
Suirbachi
Newbie Poster
1 post since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

BitBlt
Practically a Posting Shark
894 posts since Feb 2011
Reputation Points: 482
Solved Threads: 148
Skill Endorsements: 14

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0753 seconds using 2.66MB