|
-
Feb 27th, 2007, 07:31 AM
#1
Thread Starter
Lively Member
Question about adding Text into Listbox
Hello guys. I'm trying to write a program in such a way that when the user types a message in Textbox A, it will add the message into the Listbox in Red color. While when the same user types the message in Textbox B, the message will be added to the Listbox in Blue color. How do I do this?
-
Feb 27th, 2007, 07:33 AM
#2
Lively Member
Re: Question about adding Text into Listbox
Wouldn't you just change the forecolor property?
-
Feb 27th, 2007, 07:39 AM
#3
Re: Question about adding Text into Listbox
 Originally Posted by zabimaru
Hello guys. I'm trying to write a program in such a way that when the user types a message in Textbox A, it will add the message into the Listbox in Red color. While when the same user types the message in Textbox B, the message will be added to the Listbox in Blue color. How do I do this?
This can be done if you want to deal with about a mile and a half of code. See Aaron Youngs code here
-
Feb 27th, 2007, 07:40 AM
#4
Re: Question about adding Text into Listbox
 Originally Posted by Arty2000
Wouldn't you just change the forecolor property?
No. The back and forecolor properties of the standard VB listbox deal with the control as a whole. Not just a single entry.
-
Feb 27th, 2007, 07:42 AM
#5
Thread Starter
Lively Member
Re: Question about adding Text into Listbox
Omg! That was pretty sick! Haha... So there's no simpler way of adding different colored text to the same listbox?
-
Feb 27th, 2007, 07:47 AM
#6
Re: Question about adding Text into Listbox
 Originally Posted by zabimaru
Omg! That was pretty sick! Haha... So there's no simpler way of adding different colored text to the same listbox?
No...and until I ran into Aaron's post, I didn't think it was possible at all.
-
Feb 27th, 2007, 07:55 AM
#7
Lively Member
Re: Question about adding Text into Listbox
No. The back and forecolor properties of the standard VB listbox deal with the control as a whole. Not just a single entry.
Oh yeah... (cough)... I knew that 
zabimaru maybe this will help?
http://vbaccelerator.com/home/VB/Cod...ox/article.asp
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|