Open secondary form on button press

Ask your Windows 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.
Locked
PaschalIT
Posts: 38
Joined: Tue Apr 02, 2019 4:37 pm

Open secondary form on button press

Post by PaschalIT » Fri Apr 05, 2019 9:17 am

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.    
  4.  
  5.     Call-GroupManagementForm_psf
  6.  
  7.    
  8.  
  9. }
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.  
  3. ERROR: Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
  4.  
  5. MainConsole.psf (600, 2): ERROR: At Line: 600 char: 2
  6.  
  7. ERROR: +         Call-GroupManagementForm_psf
  8.  
  9. ERROR: +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10.  
  11. ERROR:     + CategoryInfo          : ObjectNotFound: (Call-GroupManagementForm_psf:String) [], CommandNotFoundException
  12.  
  13. ERROR:     + FullyQualifiedErrorId : CommandNotFoundException
  14.  
  15. ERROR:

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Open secondary form on button press

Post by davidc » Fri Apr 05, 2019 9:33 am

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
Joined: Tue Apr 02, 2019 4:37 pm

Re: Open secondary form on button press

Post by PaschalIT » Fri Apr 05, 2019 9:37 am

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!

Locked