SetTextColor?

This is a discussion on SetTextColor? within the Windows Programming forums, part of the Platform Specific Boards category; I need the whole background one color...

  1. #16
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Unhappy I need...

    I need the whole background one color
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #17
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Yes, you paint the background with a HBRUSH, and text background with SetBkColor().
    zen

  3. #18
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,853

    Owner Draw Listbox

    Or you use an owner draw listbox and write a paint function for it. Harder to do but much more control. Different columns / rows / items can have different colours / fonts ect.

    Calling the paint function in response to a WM_DRAWITEM msg.

    Code:
    case WM_DRAWITEM:
    pDrawItem = (DRAWITEMSTRUCT *)lParam;
    In the ListBoxRepaint function;
    Find the text with LVM_GETITEMTEXT and SendMessage()
    Find the column widths with LVM_GETCOLUMNWIDTH and so find the column's client rectangle.
    Work out where you want the text with GetTextExtentPoint32() and so the text's client rectangle.
    FrameRect() and FillRect() to colour in as well as SetBkColour() and SetTextColour().
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #19
    Unregistered
    Guest
    I have described the procedure here (with a little example in C)

    http://board.win32asmcommunity.net/s...&threadid=1519


    LuHa.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SetTextColor question
    By Tropicalia in forum Windows Programming
    Replies: 3
    Last Post: 10-12-2006, 06:58 AM
  2. Problems with SetTextColor()
    By Tronic in forum Windows Programming
    Replies: 2
    Last Post: 05-15-2004, 10:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21