text on owner-drawn button?

This is a discussion on text on owner-drawn button? within the Windows Programming forums, part of the Platform Specific Boards category; How do I put text on a button that has BS_OWNERDRAW style?...

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

    Question text on owner-drawn button?

    How do I put text on a button that has BS_OWNERDRAW style?
    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. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    WM_DRAWITEM handler - use any of the text writing fns: TextOut, ExtTextOut etc.

    Or if your text is fixed, stick in on the bmp for the butto states and use that instead.

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

    Question How do I...

    How do I use the WM_DRAWITEM message?
    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

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Your owner-drawn button should send a WM_DRAWITEM message. Catch it and use TextOut()

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

    Question One more question...

    ...EDIT...

    Nevermind. How do I add a BMP to an owner-drawn button?
    Last edited by SyntaxBubble; 02-17-2002 at 12:57 PM.
    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

  6. #6
    Registered User Italia's Avatar
    Join Date
    Feb 2002
    Posts
    13
    Just treat the ownerdrawn as if it was a normal child window. Same idea for most things (just a little bit different, like the message that is sent).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. button text?
    By Marcuzen-90 in forum Windows Programming
    Replies: 1
    Last Post: 01-05-2006, 04:48 PM
  2. Hide toobar button by tooltip text
    By Br5an in forum Windows Programming
    Replies: 0
    Last Post: 07-11-2005, 02:26 PM
  3. Replies: 3
    Last Post: 05-25-2005, 02:50 PM
  4. Owner drawn edit text; flickers.
    By bennyandthejets in forum Windows Programming
    Replies: 5
    Last Post: 10-09-2003, 02:02 AM
  5. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 10:45 PM

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