For the text it can be done by reacting To the WM_CTLCOLORSTATIC message For the control by SetBkMode_(wParam,#TRANSPARENT), SetTextColor_(wParam,<desired text color>), And returning a SolidBrush your desired background color. For the box I've never tried to do that, so I'm not sure but it can probably be managed somehow. I'll study on it for a bit and let you know if something occurs.
Code: Select all
Global GadgetFrg=#Black, GadgetBkg = CreateSolidBrush_(#Green)
Procedure WindowProc(hWnd, Msg, wParam, lParam)
result = #PB_ProcessPureBasicEvents
If Msg=#WM_CTLCOLORSTATIC
If GetDlgCtrlID_(lparam) = 1
SetBkMode_(wParam,#TRANSPARENT)
SetTextColor_(wParam,GadgetFrg)
result = GadgetBkg
EndIf
EndIf
ProcedureReturn result
EndProcedure
OpenWindow(0,0,0,260,160,"test",#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
SetWindowCallback(@WindowProc())
CreateGadgetList(WindowID(0))
CheckBoxGadget(1,10,20,245,20,"Checkbox gadget with a green background")
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
DeleteObject_(GadgetBkg)