VB3 Display Multiple Foreground Text Colors in VB List BoxLast reviewed: January 9, 1997Article ID: Q108811 |
The information in this article applies to:
- Standard and Professional Editions of Microsoft Visual Basic for Windows, version 3.0
SUMMARYTo 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. This article describes how to display words of different colors simultaneously in a list box by using an indirect technique.
MORE INFORMATIONYou can display lines or words of different colors simultaneously in a list box by using one of the following indirect techniques.
How to Contact DesawareNOTE: Desaware products are manufactured independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding these products' performance or reliability. Desaware 5 Town & Country Village #790 San Jose, CA 95128 Contact: Dan Appleman (408) 377-4770 Fax: (408) 371-3530 The Desaware company offers the following products:
Owner-Draw Controls in WindowsThe owner-draw list capability is appropriate for advanced programmers for Microsoft Windows. You will need a good reference for the Windows API to learn the required drawing functions. Owner-draw controls were introduced in Windows version 3.0. Because your application does all the drawing of the contents of the controls, you can customize them any way you like. Owner-draw controls are similar to predefined controls in that Windows will handle the control's functionality and mouse and keyboard input processing. However, you are responsible for drawing the owner-draw control in its normal, selected, and focus states. You can create owner-draw controls from the menu, button, and list-box classes. You can create owner-draw combo boxes, but they must have the CBS_DROPDOWNLIST style, which equates to a static text item and a list box. The elements of an owner-draw control can be composed of strings, bitmaps, lines, rectangles, and other drawing functions in any combination, in your choice of colors.
REFERENCES
|
KBCategory: kbprg kb3rdparty
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |