Mainform title

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
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.
This topic is 2 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
owinsloe
Posts: 161
Last visit: Tue Mar 26, 2024 8:14 pm
Been upvoted: 1 time

Mainform title

Post by owinsloe »

Product: PowerShell Studio 2021 (64 Bit)
Build: v5.8.188
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.19042.0

When creating a new form the MainForm, the name defaults to the title assignment as it does for other controls. We have a standard to assign a specific format to the main form title, which is <product> V<version> (c) <company name>

This creates a name that's not particularly nice. eg. $formCnwservicesV1006cJad

While this doesnt impact the behaviour when assigning other events & controls as it defaults to the initial name assignment, aesthetically, it's not that nice and it also truncates from the full title. Older versions of PSS use to use MainForm as the main title & other controls used the control name followed by an incrementing integer. I dont have too much issue with non-title controls using their label text as it's reasonably useful when reading through the code.

But with the mainform it's useful when jumping from project to project when you're searching for comparisons on specific settings. eg. may be looking for $Mainform.refresh(). Is the only way to change this behaviour to update the Design.Name?
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Mainform title

Post by brittneyr »

You are correct, the only way the Name property is not updated is if you update the control or form name. When the text is set on a control or form and the name of the control has not been set manually, the Name property is updated. This behavior is consistent with older builds of PowerShell Studio and there are no plans to change this.
Brittney
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Mainform title

Post by Alexander Riedel »

[Topic moved by moderator]
Please post in the corresponding product forum for product related questions.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 2 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.