Product, version and build: PowerShell Studio 2018 v5.5.150
32 or 64 bit version of product: 64-bit
Operating system: Windows 10
32 or 64 bit OS: 64-bit
1) I created a GUI project in PSS on my laptop, everything looked great, exported to .ps1.
2) After a few days I reopened the project to adjust a typo. This time my laptop was connected to an high-resolution external monitor as primary screen with system-wide screen text size set to 150%.
3) I corrected an one-character typo in the script logic (unrelated to GUI, haven't touched GUI at all). Reexported as .ps1.
4) Upon committing to a repo, I noticed that PSS automatically updated all form element coordinates, some margins etc.
5) The form now looks unreadable. The previous version looked properly scaled and fine with either 100% or 150% text size.
Before:
After:
Thank you!
Screen text size
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
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 LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Screen text size
The .NET designer renders and sizes controls depending on the current DPI.
https://info.sapien.com/index.php/guis/ ... i-displays
If you can, please zip and load up the original psf file, so that we can attempt to recreate the issue:
https://www.sapien.com/support/upload
What resolution and scaling did you have when you originally created the form?
Thank you,
https://info.sapien.com/index.php/guis/ ... i-displays
If you can, please zip and load up the original psf file, so that we can attempt to recreate the issue:
https://www.sapien.com/support/upload
What resolution and scaling did you have when you originally created the form?
Thank you,
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- cofense_egor
- Posts: 4
- Last visit: Fri Jul 13, 2018 11:24 am
Re: Screen text size
Original resolution: 1920x1080x100%
New resolution: 3840x2160x150%
Unfortunately, I clicked "save all" after making that minor change, so I no longer have the separate PSF. But I do have the original export ps1 from my repo which seems to contain some recovery regions. Not sure this is helpful, but I uploaded it. Thank you.
New resolution: 3840x2160x150%
Unfortunately, I clicked "save all" after making that minor change, so I no longer have the separate PSF. But I do have the original export ps1 from my repo which seems to contain some recovery regions. Not sure this is helpful, but I uploaded it. Thank you.
Re: Screen text size
It looks like the problem are the labels themselves. If you have a label's AutoSize disabled and don't explicitly set a font, WinForms will incorrectly scale the control in a high DPI environment (Refer to the article I linked to in my previous post).
You can resolve the issue by setting AutoSize to True and left align the text or set the font of the labels.
You can resolve the issue by setting AutoSize to True and left align the text or set the font of the labels.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- cofense_egor
- Posts: 4
- Last visit: Fri Jul 13, 2018 11:24 am
Re: Screen text size
Thank you for your reply! I am not too concerned about the appearance. I do realize that I did not follow best practices and form elements may render incorrectly as text size changes. My real concern is that each time I connect the monitor, make a one byte change and export, PSS updates all form coordinates, adds margins etc and I end up with a huge commit. I tried to switch back from 150% to 100% and re-export and it did that again and not just for labels, but for every element.
Before (150%):
After (100%):
Is this expected? Can it be turned off?
Before (150%):
- $groupbox1.Controls.Add($buttonLookup)
- $groupbox1.Controls.Add($labelTicketNumber)
- $groupbox1.Controls.Add($txtZendeskTicketNo)
- $groupbox1.Location = '20, 18'
- $groupbox1.Margin = '5, 5, 5, 5'
- $groupbox1.Name = 'groupbox1'
- $groupbox1.Padding = '5, 5, 5, 5'
- $groupbox1.Size = '487, 83'
- $groupbox1.TabIndex = 0
- $groupbox1.TabStop = $False
- $groupbox1.Text = 'Zendesk Lookup'
- $groupbox1.UseCompatibleTextRendering = $True
- $groupbox1.Controls.Add($buttonLookup)
- $groupbox1.Controls.Add($labelTicketNumber)
- $groupbox1.Controls.Add($txtZendeskTicketNo)
- $groupbox1.Location = '12, 12'
- $groupbox1.Name = 'groupbox1'
- $groupbox1.Size = '292, 54'
- $groupbox1.TabIndex = 0
- $groupbox1.TabStop = $False
- $groupbox1.Text = 'Zendesk Lookup'
- $groupbox1.UseCompatibleTextRendering = $True
Re: Screen text size
You will still encounter issues when running the script in high DPI settings if you don't apply the solutions I mentioned above.
When you work in the designer, the current DPI settings will affect the generated code. The generated code stores the original designer DPI information and when the script runs, the controls will scale automatically depending the running machine's DPI.
When you work in the designer, the current DPI settings will affect the generated code. The generated code stores the original designer DPI information and when the script runs, the controls will scale automatically depending the running machine's DPI.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- cofense_egor
- Posts: 4
- Last visit: Fri Jul 13, 2018 11:24 am