Change window style from bordered to borderless and back?
Change window style from bordered to borderless and back?
Is it possible to change the style of a window from bordered to borderless and back while the program is running?
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
Maybe, this should help.
Code: Select all
; 2006 Hroudtwolf
; PB 4.00
If OpenWindow(0, 0, 0, 200, 200, "Remove windowstyle", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #WS_BORDER) And CreateGadgetList(WindowID(0))
ButtonGadget(0, 10, 10, 180, 20, "No Border")
ButtonGadget(1, 10, 40, 180, 20, "Border")
Repeat
Event.l=WaitWindowEvent()
If Event.l=#PB_Event_Gadget
HideWindow (0,1)
If EventGadget()=0
SetWindowLong_(WindowID(0),#GWL_STYLE,GetWindowLong_(WindowID(0),#GWL_STYLE)& ~#WS_BORDER)
ElseIf EventGadget()=1
SetWindowLong_(WindowID(0),#GWL_STYLE,GetWindowLong_(WindowID(0),#GWL_STYLE)|#WS_BORDER)
EndIf
HideWindow (0,0)
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
Last edited by Hroudtwolf on Thu Mar 23, 2006 12:54 pm, edited 1 time in total.