M m4.s Member Licensed User Longtime User Mar 8, 2024 #1 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).
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 Mar 8, 2024 #2 Try this code B4X: Copy MainForm.As(JavaObject).GetField("stage").As(JavaObject).RunMethod("setResizable", Array(False)) Upvote 0
Try this code B4X: Copy MainForm.As(JavaObject).GetField("stage").As(JavaObject).RunMethod("setResizable", Array(False))
M m4.s Member Licensed User Longtime User Mar 11, 2024 #3 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
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.}