0
votes

I have a form with several field controls and buttons below them. The requirement was to make this form maximized when opened. I did it by overriding form's run method and after super() I put WinAPI::forceMaximizeWindow(element.hWnd());

Field controls I have in one group and buttons in buttonGroup. These two groups are in one group which itself is in design node. What I want to do is to make these field controls and buttons to be aligned in the center of the maximized form, by properties or by code. I was thinking to get somehow the width and height of maximized form and to assign the left and top values to that group.

Any advice is appreciate.

Thanks.

1

1 Answers

2
votes

Sort of strange request but to get the form's width/height:

element.design().widthValue();

element.design().heightValue();

Example to set it:

element.design().height(element.design().heightValue()/2);

element.design().width(element.design().widthValue()/2);