How to view form code

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 10 years and 1 month 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
PGomersall
Posts: 131
Last visit: Thu Feb 15, 2024 12:14 pm

How to view form code

Post by PGomersall »

Hi at Sapien forums,
Just purchased PowerShell Studio 2012.
Is it possible to view and edit the underlying form and object code from within PowerShell Studio 2012 rather than editing the individual object properties in the UI? The script pane does not show the underlying code for the objects on the form.
Thanks,
Pete
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: How to view form code

Post by davidc »

You can manipulate the form control objects via the script editor using the control event.

For example, the use the Form's load event to dynamically initialize the controls:
PowerShell Code
Double-click the code block to select all.
$form1_Load={
	#TODO: Initialize Form Controls here
	$button1.Enable = $false
	$form1.Text = "New title for the form"
}

David
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: How to view form code

Post by davidc »

If you wish to view the generated code, you can export the script (Export tab) to a ps1 file.

Note: It is not recommended to edit generated code, because these changes cannot be carried back into the pff file.

David
David
SAPIEN Technologies, Inc.
User avatar
PGomersall
Posts: 131
Last visit: Thu Feb 15, 2024 12:14 pm

Re: How to view form code

Post by PGomersall »

These answer my question.
This topic is 10 years and 1 month 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.