Revert the green button to maximize

Is there any declare or a special way to make the green button act as it did in the past, simply maximize the window, instead of going full screen ?

I tried to locate that in the forum, but in spite of numerous threads about that, found nothing conclusive.

option click it

// Prevent Full Screen Declare Function collectionBehavior Lib "AppKit" Selector "collectionBehavior"(obj As Integer) As UInteger Declare Sub setCollectionBehavior Lib "AppKit" Selector "setCollectionBehavior:"(obj As Integer, value As UInteger) Const NSWindowCollectionBehaviorFullScreenAuxiliary As UInteger = 256 Dim behavior As UInteger = collectionBehavior(Self.Handle) setCollectionBehavior(Self.handle, behavior Or NSWindowCollectionBehaviorFullScreenAuxiliary)

Thank you.

I did not know the option click thing.

Marco, where do you put the declare ?

I placed in the Open event, nothing has changed. Still fullscreen :frowning:

That’s weird.
I just tried again. New project. Run. If your mouse is over the green button, you see it change to the full screen thingies <>. If I click it, it goes full screen.

Then I put the above in window1.Open. The mouseover now shows a + and it maximizes instead of full screen.

edit: Make sure the switch “Full Screen button” in the inspector for the Window is off.

Strange. It did not work in an older project, it works just fine in a brand new test project.

Thank you Marco :slight_smile:

Or you can double-click the titlebar.