Open secondary form on button press

Ask your PowerShell-related questions, including questions on cmdlet development!
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 11 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
PaschalIT
Posts: 38
Last visit: Fri Jan 10, 2020 7:38 am

Open secondary form on button press

Post by PaschalIT »

Hi guys, I'm back! I have a new question this time, though; the solution for my previous problem is working. (Thanks for that btw)

This time I'm trying to open a secondary form when a button is clicked, but when I try it I only get errors. I have tried running the project as a whole (ctrl-F4), and nothing changes. The form I'm trying to open is called "GroupManagementForm.psf", and it is included in the project.

The code in question:
  1. $buttonEditGroups_Click={
  2.    
  3.     Call-GroupManagementForm_psf
  4.    
  5. }
The error:
  1. ERROR: Call-GroupManagementForm_psf : The term 'Call-GroupManagementForm_psf' is not recognized as the name of a cmdlet, function, script file, or operable program.
  2. ERROR: Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
  3. MainConsole.psf (600, 2): ERROR: At Line: 600 char: 2
  4. ERROR: +         Call-GroupManagementForm_psf
  5. ERROR: +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. ERROR:     + CategoryInfo          : ObjectNotFound: (Call-GroupManagementForm_psf:String) [], CommandNotFoundException
  7. ERROR:     + FullyQualifiedErrorId : CommandNotFoundException
  8. ERROR:
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Open secondary form on button press

Post by davidc »

The Call verb was replaced with the Show verb a while back. Refer to the following article:

https://www.sapien.com/blog/2016/11/15/ ... -v5-3-130/
David
SAPIEN Technologies, Inc.
PaschalIT
Posts: 38
Last visit: Fri Jan 10, 2020 7:38 am

Re: Open secondary form on button press

Post by PaschalIT »

Ah! Thank you!

For some reason all my searches were only coming up with references to Call-, so I was just stuck in a losing battle, I suppose.

That was exactly what I was missing. Thanks David!
This topic is 4 years and 11 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