hello
i'm trying to make an edit box control with a specified background
(bmp image)
could any one direct me how to do it?
thanks
i'm trying to make an edit box control with a specified background
(bmp image)
could any one direct me how to do it?
thanks
CreatePatternBrush, WM_CTLCOLOREDIT.
it tried it doesn't work
maybe you can show some piece of (working) code?
or you wanna see mine first?
thanks!
maybe you can show some piece of (working) code?
or you wanna see mine first?
thanks!
use STM_SETIMAGE in a "SendMessage" call to you static control! this should work!
bye
bye
ooops, sorry.. you wanted to set an background image to an edit control..
erm.. how about drawing the control yourself?
don't ask me how to do that :tongue: , i just know that it's possible. just look for owner drawn controls..
hope that helps somehow..
bye
erm.. how about drawing the control yourself?
don't ask me how to do that :tongue: , i just know that it's possible. just look for owner drawn controls..
hope that helps somehow..
bye
What Comrade is getting at:
You should check MSDN for the CreatePatternBrush API and WM_CTLCOLOREDIT window message. You would find that an edit control sends a WM_CTLCOLOREDIT message to it's parent before it erases it's background to determine which brush to use to paint the background. If you handle this message, pass it a brush made from CreatePatternBrush in eax.
--Chorus
WinProc PROC hWin,uMsg,wParam,lParam:DWORD
mov eax,uMsg
cmp eax,WM_CTLCOLOREDIT
je @@CtlColorEdit
cmp eax,WM_CREATE
je @@Create
cmp eax,WM_DESTROY
je @@Destroy
...
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
...
@@CtlColorEdit:
mov eax,EditBackgrondBrush
ret
@@Create:
invoke CreatePatternBrush,hBitmap
mov EditBackgroundBrush,eax
ret
@@Destroy:
invoke DeleteObject,EditBackgroundBrush
ret
WinProc ENDP
You should check MSDN for the CreatePatternBrush API and WM_CTLCOLOREDIT window message. You would find that an edit control sends a WM_CTLCOLOREDIT message to it's parent before it erases it's background to determine which brush to use to paint the background. If you handle this message, pass it a brush made from CreatePatternBrush in eax.
--Chorus
IIRC, KetilO tried to do this some time ago, the source code was posted, it only has a bit of flickering I think : search the board to find it.
alright, i see
well, can i do static box with scrolling?
cuz, if so, is solves the whole problem..
i was trying the createpatternbrush - the problem is that when you scroll in the edit box, the bkg is scrolled as well....so it scrambles too
i have to make it fixed some how..
and i don't wanna write my own control...altough it shouldn't be hard, but there have to be a way to do it!
thanks
well, can i do static box with scrolling?
cuz, if so, is solves the whole problem..
i was trying the createpatternbrush - the problem is that when you scroll in the edit box, the bkg is scrolled as well....so it scrambles too
i have to make it fixed some how..
and i don't wanna write my own control...altough it shouldn't be hard, but there have to be a way to do it!
thanks