B4J Question How to programmatically disable and re-enable form 'Restore' button?

m4.s

Member
Licensed User
Longtime User
There are lots of examples in the B4J forum on how to do so for a form's Maximize button, but not for its Restore (normalize) button. Possible?

Note: Asking because I'm forcing my application's main form to be maximized when running in certain UI modes, and then want to restrict any form resizing (except minimizing) until/unless the user changes to a different UI mode (where resizing is again permitted).
 

teddybear

Well-Known Member
Licensed User
Try this code
B4X:
MainForm.As(JavaObject).GetField("stage").As(JavaObject).RunMethod("setResizable", Array(False))
 
Upvote 0

m4.s

Member
Licensed User
Longtime User
Thank you @teddybear for your quick response.

That code does indeed prevent all form resizing, but does not disable the restore button when a form is maximized. Apologies for not being clearer re: what I needed.

But after further research and testing, I found that I could simply [dynamically] change the main form's Resizable property to false, and then back to true, whenever/as required in my application. {I didn't realize I could do that without having to reload the form.}
 
Upvote 0
Top