Board index » off-topic » Change BK of a TRadioButton
|
Alexander Sulfrian
Delphi Developer |
|
Alexander Sulfrian
Delphi Developer |
Change BK of a TRadioButton2003-10-11 12:07:49 AM off-topic16 Hi, how can I change the BackgroundColor of a RadioButton in TPW1.5? I tried SerBkColor, but it doesn't work! Cak you help me? Thanks Alexander Sulfrian |
| kbarthelmess
Delphi Developer |
2003-10-11 03:55:38 AM
Re:Change BK of a TRadioButton
"Alexander Sulfrian" < XXXX@XXXXX.COM >wrote:
Quotehow can I change the BackgroundColor of a RadioButton in TPW1.5? all that trouble since you have to take responsibility for all the other logic for handling the radio buttons as well. Good luck. Kurt |
| Alexander Sulfrian
Delphi Developer |
2003-10-11 05:43:35 AM
Re:Change BK of a TRadioButton
Hi,
it is not fine, that I cannot change the color fof the RadioButtons! But is there anywhere a unit to download that supports colorful radioButtons? Thanks Alexander Sulfrian @Kurt: Sorry for the Mails! I pressed in this program here the wrong button! "Kurt Barthelmess (TeamB)" < XXXX@XXXXX.COM >schrieb im Newsbeitrag news: XXXX@XXXXX.COM ... Quote"Alexander Sulfrian" < XXXX@XXXXX.COM >wrote: {smallsort} |
| Alexander Sulfrian
Delphi Developer |
2003-10-11 06:10:10 AM
Re:Change BK of a TRadioButton
Hi,
can I mayby set the backgrount transparent? I have seen a code for WinAPI in c++, that does exactly that! case WM_CTLCOLORBTN: SetBkMode((HDC)wParam, TRANSPARENT); return (long)GetStockObject(HOLLOW_BRUSH); This you have to insert into the mai MessageLoop of a Program! Can I use this Code with TPW1.5 (or BPW7)? Thanks Alexander Sulfrian "Kurt Barthelmess (TeamB)" < XXXX@XXXXX.COM >schrieb im Newsbeitrag news: XXXX@XXXXX.COM ... Quote"Alexander Sulfrian" < XXXX@XXXXX.COM >wrote: |
| kbarthelmess
Delphi Developer |
2003-10-11 08:10:29 AM
Re:Change BK of a TRadioButton
"Alexander Sulfrian" < XXXX@XXXXX.COM >wrote:
Quoteit is not fine, that I cannot change the color fof the RadioButtons! QuoteBut is there anywhere a unit to download that supports colorful Good luck. Kurt |
| kbarthelmess
Delphi Developer |
2003-10-11 08:14:35 AM
Re:Change BK of a TRadioButton
"Alexander Sulfrian" < XXXX@XXXXX.COM >wrote:
Quotecan I mayby set the backgrount transparent? I have seen a code for WinAPI in think the WM_CTLCOLORBTN messages were implemented until Win 32. If they were, you can watch for that message and respond as indicated. The equivalent Pascal code would probably be something like: SetBkMode(Msg.WParam, TRANSPARENT); Msg.Result := GetStockObject(HOLLOW_BRUSH); Good luck. Kurt |
| Alexander Sulfrian
Delphi Developer |
2003-10-11 06:06:54 PM
Re:Change BK of a TRadioButtonQuote.. Since you are school! Personal I am running Windows XP! I will try it, but I don't know correctly, how I can watch for the Message! IFRC I saw in the Help the TPW supports the WM_CTLCOLOR Message, can I also use that? Thanks! Alexander Sulfrian "Kurt Barthelmess (TeamB)" < XXXX@XXXXX.COM >schrieb im Newsbeitrag news: XXXX@XXXXX.COM ... Quote"Alexander Sulfrian" < XXXX@XXXXX.COM >wrote: |
| kbarthelmess
Delphi Developer |
2003-10-11 09:15:21 PM
Re:Change BK of a TRadioButton
"Alexander Sulfrian" < XXXX@XXXXX.COM >wrote:
Quoteoh no! I don't run Win3.x! I writing in TPW only, because we must do that at QuoteI will try it, but I don't know correctly, how I can watch for the Message! procedure WMCtlColorBtn(var Msg: TMessage); virtual WM_FIRST + WM_CTLCOLORBTN; However, since WM_CTLCOLORBTN is not defined in your version of OWindows.pas, you'll need to define it yourself. The value is $0135. QuoteIFRC I saw in the Help the TPW supports the WM_CTLCOLOR Message, can I also WM_CTLCOLORBTN (and related control specific) messages. But Win 32 may send the "old style" messages to a 16 bit application like yours. You may have to put in both handlers and see which one is called. Good luck. Kurt |
| Alexander Sulfrian
Delphi Developer |
2003-10-12 04:37:34 AM
Re:Change BK of a TRadioButton
Hi,
i have it! This code is working: procedure WMCtlColorBtn(var Msg: TMessage); virtual WM_FIRST + WM_CTLCOLOR; procedure WMCtlColorBtn(var Msg: TMessage); begin SetBkMode(Msg.WParam, TRANSPARENT); Msg.Result := GetStockObject(HOLLOW_BRUSH); end; With this Code the Backgorund of the RadioButtons gets transparent. The other Msg (WM_CTLCOLORBTN) you didn't get in the TPW Program! OK! Thanks for all Help! Alexander Sulfrian "Kurt Barthelmess (TeamB)" < XXXX@XXXXX.COM >schrieb im Newsbeitrag news: XXXX@XXXXX.COM ... Quote"Alexander Sulfrian" < XXXX@XXXXX.COM >wrote: |
| Alexander Sulfrian
Delphi Developer |
2003-10-18 12:27:19 AM
Re:Change BK of a TRadioButton
"Kurt Barthelmess (TeamB)" < XXXX@XXXXX.COM >schrieb im
Newsbeitrag news: XXXX@XXXXX.COM ... "Alexander Sulfrian" < XXXX@XXXXX.COM >wrote: Quote
The following code change the bk-color of the components in Window! procedure Window.WMCtlColorBtn(var Msg: TMessage); var logBrush: TLogBrush; begin SetBkMode(Msg.WParam, TRANSPARENT); logBrush.lbStyle := bs_Solid; if (GetSysColor(COLOR_WINDOW) < RGB(25,25,25)) then logBrush.lbColor := GetSysColor(COLOR_WINDOW) + RGB(25,25,25) else logBrush.lbColor := GetSysColor(COLOR_WINDOW) - RGB(25,25,25); Msg.Result := CreateBrushIndirect(logBrush); end; Alexander Sulfrian BUT: It doesn't work with Buttons! (but with RadioButtons) |
