Product, version and build: 5.8.187
Operating system: Windows 10
PowerShell version(s): 5
32-bit version of software? No
I have many scripts that were created with PS Studio 2019. I am now using PS Studio 2021 (5.8.187) and when I load the PSF, they are 'upgraded'. The script looks fine in the editor, but when running the script some checkbox text and radiobox text are not formatted correctly.
View in editor and also how the script looks when running as deployed in PS Studio 2019
View of script as it actually runs after being 'upgraded' by PS Studio 2021
Autosize is enabled on these items.
2019 -> 2021 psf updates break formatting
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
- robert.ganshorn
- Posts: 54
- Last visit: Sat Nov 25, 2023 8:17 pm
Re: 2019 -> 2021 psf updates break formatting
There was changes to the generated code in 2020 for the release of PowerShell 7 as well as changes to frameworks that PowerShell Studio was built with which may have caused this. I recommend anchoring controls to ensure they properly size.
You also say 'deployed', was your original form packaged as an executable?
You also say 'deployed', was your original form packaged as an executable?
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- robert.ganshorn
- Posts: 54
- Last visit: Sat Nov 25, 2023 8:17 pm
Re: 2019 -> 2021 psf updates break formatting
The original was PS1. I generally don't export to exe unless absolutely necessary.
The issue is happening because the autosize attribute value is not being written in the code even though it's set in the PSF file. When I manually add $checkboxDoNotResetPassword.autosize = $True, the text is displayed correctly.
This is happening to checkboxes and radiobuttons. I have these controls in a groupbox.
New code missing autosize:
The issue is happening because the autosize attribute value is not being written in the code even though it's set in the PSF file. When I manually add $checkboxDoNotResetPassword.autosize = $True, the text is displayed correctly.
This is happening to checkboxes and radiobuttons. I have these controls in a groupbox.
New code missing autosize:
- # checkboxDoNotResetPassword
- #
- $checkboxDoNotResetPassword.Enabled = $False
- $checkboxDoNotResetPassword.ForeColor = [System.Drawing.Color]::Black
- $checkboxDoNotResetPassword.Location = New-Object System.Drawing.Point(40, 427)
- $checkboxDoNotResetPassword.Margin = '5, 5, 5, 5'
- $checkboxDoNotResetPassword.Name = 'checkboxDoNotResetPassword'
- $checkboxDoNotResetPassword.Size = New-Object System.Drawing.Size(201, 25)
- $checkboxDoNotResetPassword.TabIndex = 27
- $checkboxDoNotResetPassword.Text = 'Do not reset password'
- $checkboxDoNotResetPassword.UseCompatibleTextRendering = $True
- $checkboxDoNotResetPassword.UseVisualStyleBackColor = $True
- $checkboxDoNotResetPassword.add_CheckedChanged($checkboxDoNotResetPassword_CheckedChanged)
- #
- robert.ganshorn
- Posts: 54
- Last visit: Sat Nov 25, 2023 8:17 pm
Re: 2019 -> 2021 psf updates break formatting
We will investigate this and get back to you soon.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- robert.ganshorn
- Posts: 54
- Last visit: Sat Nov 25, 2023 8:17 pm
Re: 2019 -> 2021 psf updates break formatting
I hope this gets fixed soon since it could affect alot of scripts I have.
Re: 2019 -> 2021 psf updates break formatting
So far we have not been able to reproduce this. Does this happen on other forms as well or just this one? Is the AutoSize property set to true when you open the form up in the designer?
Can you please upload a sample form that demonstrates this behavior:
https://www.sapien.com/support/upload
Can you please upload a sample form that demonstrates this behavior:
https://www.sapien.com/support/upload
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- robert.ganshorn
- Posts: 54
- Last visit: Sat Nov 25, 2023 8:17 pm
Re: 2019 -> 2021 psf updates break formatting
I've uploaded the psf and exported ps1.
If you run the PSF from within PS Studio, you can hopefully see the issue.
I may have had autosize turned off for the password reset checkbox from testing
Rob
If you run the PSF from within PS Studio, you can hopefully see the issue.
I may have had autosize turned off for the password reset checkbox from testing
Rob
- robert.ganshorn
- Posts: 54
- Last visit: Sat Nov 25, 2023 8:17 pm
Re: 2019 -> 2021 psf updates break formatting
Actually the issue may not be autosize related at all, but something with the font scaling or dpi. I'm just not sure. Running a script from PS Studio also seems to scale differently as opposed to if it was deployed to ps1 and run standalone.
It seems very much trial and error at this point trying to figure this out.
Rob
It seems very much trial and error at this point trying to figure this out.
Rob