On Windows you can manage the checkbox and option backgrounds by handling the WM_CTLCOLORSTATIC message. Unfortunately for buttons, Windows will ignore any brushes you return from WM_CTLCOLORBTN unless the button is ownerdrawn:
MSDN wrote:The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message.
Here is code for the check and option, as you can see it's quite simple to manage:
Code: Select all
Global hBrush = CreateSolidBrush_(RGB(0,$8f,0))
Procedure WinProc(hwnd, msg, wparam, lparam)
result = #PB_ProcessPureBasicEvents
Select msg
Case #WM_CTLCOLORSTATIC
ProcedureReturn hBrush
EndSelect
ProcedureReturn result
EndProcedure
OpenWindow(0,0,0,100,120,"BUTTONSHADOW")
SetWindowColor(0,RGB($00,$8f,$00))
SetWindowCallback(@WinProc())
ButtonGadget(3,10,10,80,40,"Button")
CheckBoxGadget(4,10,60,80,20,"CheckBox")
OptionGadget(5,10,90,80,20,"Option")
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
You should have no difficulty finding example code for ownerdrawing buttons on these forums or Purearea should you want to give it a go.