Fastidious
Fastidious

Reputation: 1319

How do I hide elements in the designer?

I am pretty new to Visual Studio and C#. So bear with me.

I created my first Windows application as a Windows Form Application. This allowed me to use the Visual Studio Designer to drag and drop GUI elements into the designer. This also allowed me to further define functionality, methods and whatnot to that elements.

What I have now is 3 buttons for 3 different parts of my application. One is a Calendar, the other is Documentation and the third is just information about the application.

I have a simple 2 column panel layout in the application with my buttons positioned at the left top of the application to leave the center open for content. My design of the first button is when clicked, it shows a panel with the elements I specified. When it's clicked a second time, it closes the panel and all the elements.

Everything works great with .Show(); and .Hide();

Now, I move onto the second button to do the same thing. New panel, Show/Hide and so forth. But the designer does not allow me to hide the original panel I made for the previous button.

How can I hide elements of the application I am not working on? If not, does that mean I have to create a new Windows form per button to layer my application? I figured I would just show and hide panels/elements per section as opposed to creating multiple forms?

Upvotes: 1

Views: 1576

Answers (1)

TGH
TGH

Reputation: 39278

I would break the different panels out as user controls that you can work on independently in different views.

Upvotes: 1

Related Questions