Can't add new form

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.
Post Reply
Rixtter747
Posts: 4
Joined: Fri Nov 29, 2019 2:34 am

Can't add new form

Post by Rixtter747 » Wed Dec 04, 2019 9:07 am

Hi folks,

So I'm adding a new multi-form project. I want the main form to load one modal form at a time, so I add a new form to my project.

I have saved the form as CoreForm.psf
I am attempting to assign a button to load the form with Show-CoreForm_psf

It doesn't recognise this, doesn't seem to have auto-generated the function for it. Is there a step I'm missing? Auto-complete displays the Show-ChildForm_psf just fine, but not my newly saved form.

I'm not finding the online help very intuitive, any advice appreciated.

Richard.

jvierra
Posts: 14009
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Can't add new form

Post by jvierra » Wed Dec 04, 2019 9:25 am

Place a breakpoint on the code line that calls the form and run the project under the debugger. Does the code stop on that line?

User avatar
mxtrinidad
Site Admin
Posts: 368
Joined: Sun Mar 03, 2013 12:42 pm

Re: Can't add new form

Post by mxtrinidad » Wed Dec 04, 2019 9:42 am

Can you please provide the code block you are using in the button control to open the "Show-CoreForm_psf" form?

User avatar
mxtrinidad
Site Admin
Posts: 368
Joined: Sun Mar 03, 2013 12:42 pm

Re: Can't add new form

Post by mxtrinidad » Wed Dec 04, 2019 9:43 am

It should look like this:

$buttonShowForm_Click={
#TODO: Place custom script here: TestUserDatagridForm01.psf
if ((Show-TestUserDatagridForm01_psf) -eq 'OK') {

}
}

jvierra
Posts: 14009
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Can't add new form

Post by jvierra » Wed Dec 04, 2019 4:09 pm

The issue you are using about likely has to do with how you added the new form. If you look at the product manual (help tab left side) it will tell you the many ways to add files and forms to a project,

The Info Center contains numerous detailed articles describing how to work with projects.

https://info.sapien.com/index.php/guis/ ... jects-work
https://info.sapien.com/index.php/guis/ ... ll-gui-app

There are dozens of articles in the Info Center.

There are videos here: https://www.youtube.com/user/SAPIENTech ... _polymer=1
And a full manual here: https://www.sapien.com/books_training/W ... werShell-4

Post Reply