Resize displayed dialog box from code

Dobore dein,
I have a 800x600 dialog box displayed on my screen
after pressing a button in that dialog box i want to hide some components and shrink it size to about
600x400. How can I achieve this?

Spasibo

Hi Eduardo!
Could you provide a little more context so we can help with your problem?

Are you trying to open the screen you created?
If so, then you can resize the window using the methods getWindow() in the right place.
However, before doing this, you should make sure that your screen is open in dialog mode.

For example:

    if (getWindow() instanceof DialogWindow) {
        ((DialogWindow) getWindow()).setDialogWidth("600px");
        ((DialogWindow) getWindow()).setDialogHeight("400px");
    }

Please write if this does not solve your problem, or if the context is misunderstood.

Regards,
Dmitriy

Casting it to Dialog and calling that method did the trick
I was trying
getWindow().setHeight(“300px”);
Balshoi Spasibo

1 Like