I want to set color & back color in a text box ? What API should i use ? Was it possible ? Does it exist an alternative to a textbox, where i could change colors ?? Thanks a lot ;);) ++
Posted on 2001-01-27 05:31:00 by Kheo
Kheo, look up a message WM_CTLCOLOREDIT for the place to set the edit colors, you need to set 3 things, the edit back color, the text for and the text back colour, its a bit messy but works OK when u get it going. Regards, hutch@pbq.com.au
Posted on 2001-01-27 09:08:00 by hutch--
Check my Pipe tutorial. It demonstrates how to change the text and background color of an edit control
Posted on 2001-01-27 10:08:00 by Iczelion
Ok, thanks a lot, i'll go to see that.. Oh sorry for my poor english ;( But thanks, i save my life ;) / Kheo /
Posted on 2001-01-28 03:25:00 by Kheo
Sorry, but it's me again ! I explain u what i've made ! I'm creating a dialogbox with the API DialogBoxParamA associated to an .RES file that contain my dialog form. I've added the comparaison to WM_CTLCOLOREDIT message but it seen not work, coz when i trace my soft with Sice, it never goes in the code section associated if this message was send.... Could u help me again? / Kheo /
Posted on 2001-01-28 03:57:00 by Kheo
The WM_CTLCOLOREDIT only works when my text box was enable ? Because i put it with a ready only flag, making it not modifiable... To which value correspond Yellow color etc .. and BLACK_BRUSH ?? I'm coding in tasm ... thanks ;) ++
Posted on 2001-01-28 04:37:00 by Kheo
Hi, Kheo ;=================================== ; Set color for edit boxes ;=================================== .if uMsg==WM_CTLCOLOREDIT ; = 133 ;edit_boxes_handle dd 0 mov eax ,edit_boxes_handle cmp eax,lParam jne not_now call SetTextColor,wParam,00FF0000h ; Blue call SetBkMode,wParam,1 ; 1 = TRANSPARENT or 2 = OPAQUE call SetBkColor,wParam, 00000000h ; Black SetBkMode call CreateSolidBrush, 0000FFFFh ; Yellow brush color value call SelectObject,wParam,eax ; With brush handle ret not_now: forge
Posted on 2001-01-28 17:09:00 by forge
Was it really possible ? it doesn't work ... I don't understand what i could forget ? As there is someone that could make me an example with a res file ? Please ..... thanks ++
Posted on 2001-01-29 08:49:00 by Kheo
When you disable a window, it is disabled, and colours itself with the default colours. It is also the same if you want you editbox to be readonly, you have no choice becasue the colour is always set to gray. However, if you start looking at rechedit controls, you will find that they are much easyier to use than edit controls, in almst all aspects. If you want to create a richedit control in a dialogbox, create it using a custom control.... CONTROL "Some Text",100,"RichEdit",ES_MULTILINE,10,10,100,100,WS_EX_CLIENTEDGE
Posted on 2001-01-29 19:44:00 by X
Hi, Kheo ;================================================== ; Set color for edit boxes read only or read/write ;================================================== You will find documented example and source at: http://www.fhills.hotkey.net.au/~forge/tempedit.zip 6253 bytes Hope this will help. forge This message was edited by forge, on 1/30/2001 5:25:48 AM
Posted on 2001-01-30 05:23:00 by forge