Search code examples
c#winformsinterfaceuser-interfacetabbed-interface

Tabbed user interface in C#


I want to create a simple tabbed interface app. I did it before in WPF using an usercontrol inside of each tab, and I comunicate with the principal form searching for a parent element (the form, or the tab control)

How could I made the same in WinForms? Which element need I put inside of each tab?

Thanks.


Solution

  • You can use pretty much the same approach in a winforms application. You can add user controls to the tab pages of a TabControl on a form. Inside the user control code you can use the FindForm method to get hold of the parent form.

    However, I would suggest that you instead use events to communicate "out" from the controls, in order to make them less dependent on their surroundings.