Greetings fellow coders, I just made a bitmap as background in my dialogbox and after running my prog I realized that the Static text in my Dialog appears in ugly grey boxes... For the question: (I bet you know already) How do I remove this ugly grey from my text? Thanks a lot, JimmyClif (As usual I used BRW for my rescource file (again))
Posted on 2000-12-01 04:56:00 by JimmyClif
I think there is a transparent option for text (look in, it may be near SS_LEFT)
Posted on 2000-12-01 05:26:00 by (scalp)
One way is to respond to WM_CTLCOLORSTATIC. Something like ; (assume wndproc has arguments named hWnd, iMsg, wParam, ; and lParam) ; ; This makes the background color behind each character ; transparent. wParam is the hDC of the static control invoke SetBkMode,wParam,TRANSPARENT ; invoke GetStockObject,NULL_BRUSH ; The return value, in EAX, from the above call is ; passed back, in EAX, to the code that called the ; wndproc or dlgproc. (This is one of about a dozen ; cases where the dlgproc doesn't return TRUE/FALSE.) ; This return value is the background brush for ; the part of the control that doesn't have text ; in it (the trailing space).
Posted on 2000-12-01 14:10:00 by ub1
Thanks for the quick answers... That did it. Before I posted I tried already responding to the WM_CTLCOLORSTATIC but I was using SetBkColor which did absolutely nothing, same as SetTextColor. Why don't they work?
Posted on 2000-12-01 15:35:00 by JimmyClif
Got it... After the WM_CTLCOLORSTATIC I *must* return a valid brush... I love it when a plan comes together :)
Posted on 2000-12-01 19:43:00 by JimmyClif
It's quite easy actually. In your resource file you'll have something like this already: LTEXT "MyText",IDC_STATIC,10,40,45,10 Now you need to append an ",WS_EX_TRANSPARENT" to the line like this: LTEXT "MyText",IDC_STATIC,10,40,45,10,WS_EX_TRANSPARENT Now it will be tranpsparent! Have fun! See ya, Ben
Posted on 2000-12-01 23:40:00 by cyberben