Sorry if this has been asked before but I have been able to find an answer in the form.
can you change the text color in a Frame3DGadget gadget?
Thanks
Craig

Code: Select all
Global TextBackground=CreateSolidBrush_(GetSysColor_(#COLOR_BTNFACE))
Global TextForeground=#Red 
Procedure WinProc(hWnd,Msg,wParam,lParam) 
  result = #PB_ProcessPureBasicEvents 
  If Msg=#WM_CTLCOLORSTATIC And lParam=GadgetID(0) 
    SetBkMode_(wParam,#TRANSPARENT) 
    SetTextColor_(wParam,TextForeground) 
    result = TextBackGround
  EndIf
  ProcedureReturn result
EndProcedure 
OpenWindow(0,0,0,250,100,"Colored Frame3D",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
CreateGadgetList(WindowID(0)) 
SetWindowCallback(@WinProc()) 
Frame3DGadget(0,10,10,230,80,"This is a Frame3D") 
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow 
DeleteObject_(TextForeground) 
DeleteObject_(TextBackground) 

A userlib is a special library created by a user wich adds functions to purebasic.sirrab wrote:Hi I'm new to purebasic, what is userlibs?gnozal wrote:If you don't mind using userlibs, PureCOLOR is an alternative.

Code: Select all
Procedure DisableXPTheme(Gadget.l)
  Protected DLL.l, Null.w
  If OSVersion() >= #PB_OS_Windows_XP
    DLL = OpenLibrary(#PB_Any, "uxtheme.dll")
    CallFunction(DLL, "SetWindowTheme", GadgetID(Gadget), @Null.w, @Null.w)
    CloseLibrary(DLL)
    ProcedureReturn #True
  EndIf
EndProcedure
Global TextBackground=CreateSolidBrush_(GetSysColor_(#COLOR_BTNFACE))
Global TextForeground=#Red
Procedure WinProc(hWnd,Msg,wParam,lParam)
  result = #PB_ProcessPureBasicEvents
  If Msg=#WM_CTLCOLORSTATIC And lParam=GadgetID(0)
    SetBkMode_(wParam,#TRANSPARENT)
    SetTextColor_(wParam,TextForeground)
    result = TextBackGround
  EndIf
  ProcedureReturn result
EndProcedure
OpenWindow(0,0,0,250,100,"Colored Frame3D",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
SetWindowCallback(@WinProc())
Frame3DGadget(0,10,10,230,80,"This is a Frame3D")
DisableXPTheme(0)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
DeleteObject_(TextForeground)
DeleteObject_(TextBackground)




Still possible!The PureColor library (while being great), doesn't set the colour of a frame3dgadget in xp theme mode.
