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 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
PGomersall
Posts: 92
Joined: Sun Mar 03, 2013 12:40 pm

How to view form code

Post by PGomersall » Mon Feb 03, 2014 11:58 am

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
Joined: Thu Aug 18, 2011 4:56 am

Re: How to view form code

Post by davidc » Mon Feb 03, 2014 12:11 pm

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
Joined: Thu Aug 18, 2011 4:56 am

Re: How to view form code

Post by davidc » Mon Feb 03, 2014 12:14 pm

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: 92
Joined: Sun Mar 03, 2013 12:40 pm

Re: How to view form code

Post by PGomersall » Mon Feb 03, 2014 12:22 pm

These answer my question.