user1015551
user1015551

Reputation: 197

C# custom GUI, better implementation?

I'm making a custom GUI for my application. Basically my application has multiple 'tabs'. Each tab has a panel control binded to it, to display tabs contents. Whenever any of the tabs are clicked, appropriate panel control becomes visible (that displays contents) and the rest of the panels become invisible.

The problem is that when I design them in Visual Studio, it's hard to work, ether panels are stacked up on each other or I put them in different coordinates, and when panel becomes active, it's location is updated.

Is there I way I could design all the panels, like on separate 'form' or something like the same way I have separate classes? if that makes sense. Thanks!

EDIT: I can't use the standard tab control, because my application has custom GUI, all buttons and everything is designed in image processing app. Tab control doesn't allow me to use my own graphics.

I'm going to take a look at UserControl, thanks everybody!

Upvotes: 0

Views: 347

Answers (3)

Michael Minton
Michael Minton

Reputation: 4495

First I would suggest you stick with the standard .NET controls in most cases. Particularly in this case the standard TabControl seems to be a good fit.

That said, you can place all the panels on the form in their final location (being sure not to place a panel within the other panel). You can then use the drop down in the Properties dialog to select the Panel you wish to work with. Next go to the Format menu and choose Order->Bring to Front. This will bring the wanted panel to the front so you may use the designer on it. You can then continue to hide or show the appropriate panels at runtime.

Upvotes: 0

Albin Sunnanbo
Albin Sunnanbo

Reputation: 47068

You can create each tab content in a separate UserControl. Use that each UserControl as the only content on each tab.

Upvotes: 1

Reed Copsey
Reed Copsey

Reputation: 564931

You should be able to design each "panel" as a separate UserControl.

Your main Form can just be composed from those UserControls, instead of having the entire UI built into one class.

Upvotes: 1

Related Questions