News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Remove Background of Textbox

Started by asmftw, December 17, 2007, 03:16:30 AM

Previous topic - Next topic

asmftw

Hello, I made an editbox with the code:

            invoke CreateWindowEx,WS_EX_CLIENTEDGE,TEXT("EDIT"),TEXT(" "),WS_CHILD+WS_VISIBLE+ES_AUTOHSCROLL,80,82,250,23,hWnd,0,hInstance,0
            mov nameWnd,eax


I can't figure out ho to set the background color though. It's not a style like those WS/ES things. Is there an api to set properties of a text box or do i have to make a subclass?

MichaelW

Are you trying to remove the background color, as in make the background transparent, or just set the background color? One simple method of setting the background color would be to handle the WM_CTLCOLOREDIT Notification in the window procedure of the parent window, returning a brush of the desired color. If the text background needed to match the edit background, then the simplest method (AFAIK) would to specify the same color in a call to SetBkColor.
eschew obfuscation

asmftw

Yeah that's what I thought it would come to, thanks for specifying though :)

Tight_Coder_Ex

I though I had an answer for you, but upon trying discovered neither method worked. 
So I erased original post and replaced it with this.