Hide objects in Designer

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.
Locked
jasondodd
Posts: 2
Joined: Tue Mar 26, 2019 5:05 am

Hide objects in Designer

Post by jasondodd »

Firstly some background information. Before I had access to PowerShell Studio I scripted up a bunch of tools with a single GUI interface by hand in a single PowerShell script. I now have access to PowerShell Studio and I looking at recreating this in PowerShell Studio to make my life easier so that I don't have to script the GUI layout of the new tool by hand each time. I can use the designer to do this and then just add the code.

How the current PowerShell script works is first it loads to a splash screen with a menu. The menu has 3 dropdown items AD Tools, Exchange Tools and General Tools each of these dropdown menus then has a list of items for each tool which I have created.
homescreen.JPG
homescreen.JPG (26.13 KiB) Viewed 509 times
When you select a tool it hides the currently displayed objects on the form and displays objects on the form required for that tool.

So now to my question is there a way that when I am in designer mode I can show/hide objects? So what I mean is so that I can work on the layout of each tool without seeing the other tools objects? Does that make sense? In the script, I will have code to show and hide the objects (set the visibility of the object to True/False) as I did with my original script which I know how to do and not asking this.

Or is there a better way to do what I am trying to achieve? I know I can use tabcontrols and have a new tab for each tool but as I have a large number of tools I don't want lots of Tabs. I also like being able to organise each tool under different hidings.

jvierra
Posts: 14674
Joined: Tue May 22, 2007 9:57 am
Answers: 6
Has voted: 1 time
Been upvoted: 5 times
Contact:

Re: Hide objects in Designer

Post by jvierra »

The designer will always show all controls. The best way to accomplish this is with panels or tabpages. You can then select or unhide the panels or tab to display the associated controls.

Most of your issue is due to lack of training and experience in how forms work and how they are intended to be designed. There is a consistent and rich technology behind forms and how we work with forms. This technology dates to the first version of Windows and has been refined over decades.

jasondodd
Posts: 2
Joined: Tue Mar 26, 2019 5:05 am

Re: Hide objects in Designer

Post by jasondodd »

Looks like I will need to go with Tabpages then thanks!

Locked