Calling 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 6 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.
Locked
User avatar
Shelltastic
Posts: 65
Last visit: Mon Feb 19, 2024 11:31 am

Calling new form

Post by Shelltastic »

Trying to simply call a new form in my project from a button. The Call-FormName function does not seem to be recognized in the scope of my project. Is there another way to do this that I am missing?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Calling new form

Post by jvierra »

Try:

Show-<form name>_psf
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Calling new form

Post by mxtrinidad »

Also, I have use the following snippet added to the button to call another form:

if((Show-ChildForm_psf) -eq 'OK')
{
## - Any code if necessary. (OPTIONAL)
}

Just another way!
:)
This topic is 6 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.
Locked