Page 1 of 1

Resizable form

Posted: Tue Sep 03, 2019 3:51 am
by stevens
To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: PS Studio, 2019, 5.6.166
32 or 64 bit version of product: 64
Operating system: W2K16
32 or 64 bit OS: 62

*** Please add details and screenshots as needed below. ***

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

Hi,

I have troubles resizing a Ps Studio forms from day 1.
So let me give it another attempt here by posting an example form which I'd like to have readable on any Windows but more specifically via an Remote Desktop session.
Problem now is:
-it doesn't resize well: everything should scale, I know I can work with anchors but is that the only option?
-text size is to small, in my production version of the tool, I could set a bigger font (I guess) but then I'd have to rework the full form by hand correct?

Thanks for helping me out here.
S.
ExampleForm.psf
exampleform
(23.35 KiB) Downloaded 7 times

Re: Resizable form

Posted: Tue Sep 03, 2019 8:56 am
by mxtrinidad
Please check the link to help you understand how to build GUI forms for high DPI displays:
https://info.sapien.com/index.php/guis/ ... x1dGlvbiJd

Let us know if it helps!

Re: Resizable form

Posted: Tue Sep 03, 2019 10:33 am
by Alexander Riedel
I should probably point out that this is not "PowerShell Studio Forms" it is Microsoft Windows Forms, just as you would use in C# etc.
I am not sure would you mean by "everything should scale" because that is not how this works. I mean to some extent, yes, but not always exactly the way you think it should.

One way of doing that is to handle the Window size event and resize your control accordingly. It is of course up to you to decide what 'accordingly' means.
The Windows Forms ability to anchor controls to the window border or other controls is quite handy and prevents you from having to write a lot of code to resize controls when the window is sized.
It requires some effort to set that up, but it works well.

As for the font size, if you are creating something for a fixed size environment, you pick the font and size at design time. If your application must consider different resolutions and scaling factors, you should determine the font size dynamically on startup based on the environment your application is running in.

Re: Resizable form

Posted: Fri Sep 06, 2019 2:57 am
by stevens
Thanks. Hope to find some time some day to go deeper in to this topic.
Was hoping for a quickfix, don't have the time to figure this all out.

For now, we will have to check other alternatives then using the Powershell GUI then.

Re: Resizable form

Posted: Tue Sep 10, 2019 7:01 am
by stevens
Are there some basics I could already improve the GUI with? If I resize the form in PS Studio, boxes get scrambled, that's my main concern. Resizing is nice to have, but not fully blocking (though font/window it is much to small to read correctly on RDS).

Re: Resizable form

Posted: Tue Sep 10, 2019 7:04 am
by Alexander Riedel
Send screenshots. Without knowing what you see and what you resolution is, its hard to tell.

Re: Resizable form

Posted: Tue Sep 10, 2019 7:05 am
by Alexander Riedel
[Topic moved by moderator]