Problem with GUI, button removed

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
Locked
User avatar
ctc_rl008
Posts: 8
Joined: Wed Jul 02, 2014 6:42 am

Problem with GUI, button removed

Post by ctc_rl008 »

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:
Operating system:
PowerShell version(s):
32-bit version of software?

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

Please see the screenshots, i have issue that the GUI look fine on my computer, but when i deploy it to other computers and run it through SCCM, it always cuts off the Ok button at the bottom of the GUI.
The first build always works fine, but when i start updating the script and create a new build the OK button is removed.
No matter how much space i keep at the bottom, the button is gone. Is there something specific I'm missing? Is there something I can configure to avoid this?

Thanks!

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Attachments
2020-10-26 14_19_39-SAPIEN PowerShell Studio 2020.png
2020-10-26 14_19_39-SAPIEN PowerShell Studio 2020.png (73.27 KiB) Viewed 136 times
2020-10-26 14_18_48-bem-w10-tst01.png
2020-10-26 14_18_48-bem-w10-tst01.png (176.93 KiB) Viewed 136 times

User avatar
brittneyr
Site Admin
Posts: 613
Joined: Thu Jun 01, 2017 7:20 am
Answers: 6
Been upvoted: 5 times

Re: Problem with GUI, button removed

Post by brittneyr »

[Topic moved by moderator to PowerShell GUIs forum]
Brittney Ryn
SAPIEN Technologies, Inc.

jvierra
Posts: 14615
Joined: Tue May 22, 2007 9:57 am
Answers: 2
Has voted: 1 time
Been upvoted: 3 times
Contact:

Re: Problem with GUI, button removed

Post by jvierra »

You need to anchor the button to the bottom and right sides of the form. This should keep it within the visible frame.

User avatar
ctc_rl008
Posts: 8
Joined: Wed Jul 02, 2014 6:42 am

Re: Problem with GUI, button removed

Post by ctc_rl008 »

I checked this, but the anchoring is set to Bottom, right

It seems it has to do with the screen resolution, the layout of the form is set to 707,877. On one of the test computers i have set the screen resolution to 1280x768. You can see the result in the screenshot.
I would have expected that the form would be out of the boundaries instead of keeping the fixed size which appears to fit perfect on the screen but start cutting off parts from the bottom.
Would it be possible to make this more variable in some kind of way, or do i just have to create the form in such a way that it would fit the lowest resolution we work with?
Attachments
2020-10-27 08_19_00-.png
2020-10-27 08_19_00-.png (855.9 KiB) Viewed 106 times

jvierra
Posts: 14615
Joined: Tue May 22, 2007 9:57 am
Answers: 2
Has voted: 1 time
Been upvoted: 3 times
Contact:

Re: Problem with GUI, button removed

Post by jvierra »

If you are moving from or to a HiDpi monitor then you will have to use techniques to detect this and adjust the position and size of thee controls in code. There is no other way to do this although you can just create two scripts from forms designed at two resolutions.

jvierra
Posts: 14615
Joined: Tue May 22, 2007 9:57 am
Answers: 2
Has voted: 1 time
Been upvoted: 3 times
Contact:

Re: Problem with GUI, button removed

Post by jvierra »

Looking at you display s43ettings shows that you are using a non-standard aspect ration which does not translate into 92X92 DPI. This will cause the forms built on this to display as you see on monitors set to normal settings. The setting is likely on a laptop which may be its maximum resolution. If you need to support this non-standard then your best bet is to move the bad controls after the form has loaded.

The normal aspect is 1024X768. Settings at higher resolutions should be chosen to allow 92X92 DPI or a higher DPI that is equal in both dimensions or you will have to use HIDPI methods to arrange the controls across different monitor settings.

User avatar
ctc_rl008
Posts: 8
Joined: Wed Jul 02, 2014 6:42 am

Re: Problem with GUI, button removed

Post by ctc_rl008 »

Thanks for your replies.

I'll think the best way to avoid it is to shrink the form itself to max 600 hight. We use this script in a PCE boot environment in SCCM, so the resolution is rather low. I'll have to review the setup or move to a 2 page form instead.

Locked