How to Display Multiple Foreground Text Colors in VB List Box (141023)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q141023 SUMMARY
To set the foreground and background color of a list box control, set the
ForeColor and BackColor properties at either design time or run time. All
text in a list box uses the color set by the ForeColor property. The text
is printed against a background color set by the BackColor property.
Visual Basic doesn't directly support the display of text of different
colors simultaneously in the list box. Multi-color list boxes do not
adhere to GUI design standards and should not be used. The Treeview
control makes it possible to differentiate list box items, by allowing the
use of bitmaps and text on the same line.
This article describes how to display words of different colors
simultaneously in a list box by using an indirect technique.
Modification Type: | Major | Last Reviewed: | 11/18/2003 |
---|
Keywords: | kb3rdparty KB141023 |
---|
|