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.
Resizable form
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: Resizable form
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!
https://info.sapien.com/index.php/guis/ ... x1dGlvbiJd
Let us know if it helps!
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Re: Resizable form
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.
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.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Resizable form
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.
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
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).
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Re: Resizable form
Send screenshots. Without knowing what you see and what you resolution is, its hard to tell.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times