Visual Studio C#, Best way to implement many "GUI Panels"

Started by
14 comments, last by unbird 8 years, 5 months ago


To do inter-page navigation, have each UserControl's navigation buttons raise an event for your Form to handle, and have the Form switch between pages. You can encapsulate these events or expose the navigation buttons directly, depending on what your personal maintainability/rapid development biases are.

Why wouldn't you just use a tab control? You're essentially recreating the wheel in a manner that's less familiar for windows users, adding extra work for yourself, and for no additional gain.

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
Advertisement

OK, I think I got what I was looking for. Nyrypen pretty much cleared my mind how user control works.

ChaosEngine it's true that the Tab Control is easier to handle. But I was looking for a different design for my app which does not include Tabs.

I wanted a solid way to transition between the "pages" without the use of tabs but the use of buttons.

User Control gives me an easy way to manage that.

Thanks for the help!

Failure is not an option...

I know you are currently using WinForms, however I would highly recommend trying out XAML (i.e. using WPF) - at least so you can see the difference between the two approaches. WPF is designed for dealing with this sort of layout stuff, you can bind the visibility of panels to properties on your view model, you can even implement animation transitions completely within XAML (i.e. slide in/out with almost zero coding). It has a steep learning curve but is really flexible and powerful - it might also be worth taking a look at some MVVM tutorials for WPF but this might be a bit advanced for right at the moment.

Good luck!

Justin Stenning | Blog | Book - Direct3D Rendering Cookbook (using C# and SharpDX)

Projects: Direct3D Hook, EasyHook, Shared Memory (IPC), SharpDisasm (x86/64 disassembler in C#)

@spazzarama

 

But I was looking for a different design for my app which does not include Tabs.

How do I create a Tab Control with no Tab Header in Windows form?

Ohhh, I didint know I could do that! Guess I will check again if a tabless tab control is more convenient for my app.

Thank you !!! :) :)

Failure is not an option...

Keep this is mind: Elaborated GUI libs come with a plethora of options. Even when not exposed by WinForms some special things can be achieved using the underlying Windows control mechanism (explicit message handling and p/invoke). You just have to find the needle in the haystack :P

This topic is closed to new replies.

Advertisement