I have a window that has a background color of white and on it I have a Frame3d gadget. I want the title/text of the frame3d gadget to be white as well so that it all matches nicely.
Unfortunately it seems that the SetGadgetColor command doesn't apply to the frame3d gadget at least where the backColor is concerned.
Is there a way to change the background color of the frame3d title?
Thanks for any help.
			
			
									
									
						Frame3d Title backcolor
- 
				phuckstepp
 - User

 - Posts: 19
 - Joined: Tue Dec 27, 2005 12:10 pm
 - Location: United Kingdom
 - Contact:
 
Use a window callback as follows:  (note PB 3.94 only. A few minor changes required for PB4)
			
			
									
									Code: Select all
Global Background
Background = CreateSolidBrush_(#White) 
Procedure WinProc(hWnd,Msg,wParam,lParam) 
result = #PB_ProcessPureBasicEvents 
  Select Msg
  Case #WM_CTLCOLORSTATIC
    result = Background 
  EndSelect 
  ProcedureReturn result
EndProcedure 
If OpenWindow(0,0,0,320,250,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Frame3DGadget")
    CreateGadgetList(WindowID(0))
      Frame3DGadget(0, 10,  10, 300, 50, "Frame3DGadget Standard")
      SetWindowCallback(@WinProc()) 
    
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
I may look like a mule, but I'm not a complete ass.
						- 
				phuckstepp
 - User

 - Posts: 19
 - Joined: Tue Dec 27, 2005 12:10 pm
 - Location: United Kingdom
 - Contact:
 
For PB4 beta 7:
			
			
									
									Code: Select all
Global Background, Foreground  
Background = CreateSolidBrush_(#White) 
Foreground = #Green
Procedure WinProc(hWnd,Msg,wParam,lParam) 
result = #PB_ProcessPureBasicEvents 
  Select Msg 
  Case #WM_CTLCOLORSTATIC 
    SetBkMode_(wParam,#TRANSPARENT) 
    SetTextColor_(wParam,Foreground) 
    result = Background 
  EndSelect 
  ProcedureReturn result 
EndProcedure 
If OpenWindow(0,0,0,320,250,"Frame3DGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
    CreateGadgetList(WindowID(0)) 
      Frame3DGadget(0, 10,  10, 300, 50, "Frame3DGadget Standard") 
      SetWindowCallback(@WinProc(),0) 
    
    Repeat 
    Until WaitWindowEvent() = #PB_Event_CloseWindow 
  EndIf 
I may look like a mule, but I'm not a complete ass.
						- 
				phuckstepp
 - User

 - Posts: 19
 - Joined: Tue Dec 27, 2005 12:10 pm
 - Location: United Kingdom
 - Contact:
 
Yes, the lParam variable holds the handle of the underlying control. Sorry, I should have mentioned that!
			
			
									
									Code: Select all
Global Background, Foreground  
Background = CreateSolidBrush_(#White) 
Foreground = #Green
Procedure WinProc(hWnd,Msg,wParam,lParam) 
result = #PB_ProcessPureBasicEvents 
  Select Msg 
  Case #WM_CTLCOLORSTATIC 
    If lParam = GadgetID(0)
      SetBkMode_(wParam,#TRANSPARENT) 
      SetTextColor_(wParam,Foreground) 
      result = Background 
    EndIf
  EndSelect 
  ProcedureReturn result 
EndProcedure 
If OpenWindow(0,0,0,320,250,"Frame3DGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
    CreateGadgetList(WindowID(0)) 
      Frame3DGadget(0, 10,  10, 300, 50, "Frame3DGadget Standard") 
      SetWindowCallback(@WinProc(),0) 
    
    Repeat 
    Until WaitWindowEvent() = #PB_Event_CloseWindow 
  EndIf 
I may look like a mule, but I'm not a complete ass.
						- 
				phuckstepp
 - User

 - Posts: 19
 - Joined: Tue Dec 27, 2005 12:10 pm
 - Location: United Kingdom
 - Contact:
 
- DoubleDutch
 - Addict

 - Posts: 3220
 - Joined: Thu Aug 07, 2003 7:01 pm
 - Location: United Kingdom
 - Contact:
 
Does anyone know how to set the text colour of a frame3dgadget with XP themes turned on?
			
			
									
									https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
						https://reportcomplete.com <- School end of term reports system
