EditBox background

This is a discussion on EditBox background within the Windows Programming forums, part of the Platform Specific Boards category; Hello. I wanna to change EditBox background image, is that possible? I tryed with WM_ERASEBKGND massage, it`s ok, image appears ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    20

    EditBox background

    Hello. I wanna to change EditBox background image, is that possible? I tryed with WM_ERASEBKGND massage, it`s ok, image appears in edit box, but I can`t see what i write in it. :/ any better suggestions ? THNX C ya
    Butterfly sweep can make torando in another side of world

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    One possibility is to handle the parent's WM_CTLCOLOREDIT (WM_CTLCOLORSTATIC for read-only edits) and return a suitable brush handle. The brush handle for an image can be created by using CreatePatternBrush or you can use one of the other brush creating api functions for different patterns/colours (eg. CreateHatchBrush and CreateSolidBrush). If you use this approach, use SetBkMode to make the text background transparent; you may also have to invalidate the control in the EN_CHANGE command notification to ensure that changes you make to the edit control's text are properly rendered.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Transparent, Editbox, HOLLOW_BRUSH, Marking text?
    By Dampy in forum Windows Programming
    Replies: 6
    Last Post: 09-22-2008, 07:17 PM
  2. Replies: 2
    Last Post: 08-25-2005, 03:09 PM
  3. Windows background color
    By Exile in forum Windows Programming
    Replies: 2
    Last Post: 01-23-2005, 06:55 AM
  4. editbox problem
    By tyouk in forum Windows Programming
    Replies: 7
    Last Post: 10-05-2004, 09:14 PM
  5. Detect Close of a background process
    By Schwarzhelm in forum C Programming
    Replies: 1
    Last Post: 11-05-2003, 12:46 AM

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