Transparent Toolbar
Posted: Thu May 10, 2012 2:43 pm
I can to put a toolbar into a container gadget. But then the toolbar loses it's transparency.
Any ideas how I could restore toolbar transparency?
Demonstration code:
Any ideas how I could restore toolbar transparency?
Demonstration code:
Code: Select all
Procedure StopToolbarAutoAlign(Toolbar)
T = ToolBarID(Toolbar)
SetWindowLongPtr_(T, #GWL_STYLE, GetWindowLong_(T, #GWL_STYLE) | #CCS_NODIVIDER| #CCS_NOPARENTALIGN| #CCS_NORESIZE)
EndProcedure
OpenWindow(0, 0, 0, 512, 384, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
SetWindowColor(0, #White);white window
ContainerGadget(1,100, 100, 400, 150)
SetGadgetColor(1, #PB_Gadget_BackColor, #White);white container
CreateToolBar(0, GadgetID(1))
SendMessage_(ToolBarID(0), #TB_SETSTYLE, 0, #TBSTYLE_TRANSPARENT);set toolbar transparency: -> toolbar should be transparent now
StopToolbarAutoAlign(0);to get rid of the toolbar topline
;add some buttons to the toolbar
ToolBarStandardButton(0, 0)
ToolBarStandardButton(0, 1)
ToolBarSeparator()
ToolBarStandardButton(0, 2)
ToolBarStandardButton(0, 3)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver