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?
Re: Question about adding Text into Listbox
Wouldn't you just change the forecolor property?
Re: Question about adding Text into Listbox
Quote:
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
Re: Question about adding Text into Listbox
Quote:
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.
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?
Re: Question about adding Text into Listbox
Quote:
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.
Re: Question about adding Text into Listbox
Quote:
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