Hey All,
I'm looking to center a button (called "btnSNCC") horizontally within a form (called "frmSN"). I know the formula would be "($frmSN.Width - $btnSNCC.Width)/2". I don't seem to be able to enter that within the Size > X field, so where would I put that code?
Thanks,
Scott
Programmatically Edit Element Property
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.
-
- Posts: 14
- Last visit: Thu Feb 22, 2024 7:41 am
Re: Programmatically Edit Element Property
Have you tried putting it in the form load event?
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 14
- Last visit: Thu Feb 22, 2024 7:41 am
Re: Programmatically Edit Element Property
As in, within the "When form loads" event in MainForm.psf?
Scott
Scott
Re: Programmatically Edit Element Property
Yes, the form's load event:
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 14
- Last visit: Thu Feb 22, 2024 7:41 am
Re: Programmatically Edit Element Property
Mine doesn't seem to have a "Load" property. See attached.
Scott
Scott
- Attachments
-
- 2022-11-04_10-30-12.png (30.16 KiB) Viewed 4706 times
Re: Programmatically Edit Element Property
Load is an event, not a property. It is the default event added when a form is created in PowerShell Studio. To view events, you need to switch to the event tab from the Property panel.
You may find the following articles helpful:
https://www.sapien.com/blog/2021/11/23/ ... ll-studio/
https://www.sapien.com/blog/2022/01/04/ ... ll-studio/
https://www.sapien.com/blog/2021/07/26/ ... ndle-them/
You may find the following articles helpful:
https://www.sapien.com/blog/2021/11/23/ ... ll-studio/
https://www.sapien.com/blog/2022/01/04/ ... ll-studio/
https://www.sapien.com/blog/2021/07/26/ ... ndle-them/
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.