CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2000
    Location
    Holland
    Posts
    14

    change fontcolor in a listbox

    Hi,

    In a listbox (List1) I've added a few lines.
    When I step through the listbox and push a button (Command1), the font of the line which is selected on that moment, has to change color.
    Only the line which is selected has to change, so not the whole listbox.
    When I step trough the listbox again, the font which was changed has to stay that color, until I select (with the button) another line. The previous selected line has to change back to the default color and the selected line has to change font color again.

    I have a way to do this, but it will affect all applications and Windows screens, but I only want to do this in my VB application.

    Does anyone has a solution.

    Thanx a lot,
    Maarten


  2. #2
    Join Date
    Jan 2000
    Location
    Bulgaria
    Posts
    2

    Re: change fontcolor in a listbox

    You can have only one color in a listbox (and also only one font).
    If you want to use multiple colors in one control, try MS Flexgrid control - there you can use separate colors for all cells.


  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: change fontcolor in a listbox

    If you use VB6 then you can use the ListView to show different coloured items in the list.

    If you must use a VB5 or want to use a listbox, then you can get code for a multi-lined / icon / coloured / all-singing-all-dancing listbox from http://www.geocities.com/SiliconValley/Foothills/9940 (called mList I think....)




    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured