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.
This topic is 4 years and 3 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.
Locked
Rixtter747
Posts: 11
Last visit: Tue Nov 08, 2022 2:44 am

Can't add new form

Post by Rixtter747 »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Can't add new form

Post by jvierra »

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
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Can't add new form

Post by mxtrinidad »

Can you please provide the code block you are using in the button control to open the "Show-CoreForm_psf" form?
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Can't add new form

Post by mxtrinidad »

It should look like this:

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

}
}
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Can't add new form

Post by jvierra »

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
This topic is 4 years and 3 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.
Locked