Hide Tab Header on C# TabControl

Viewed 54196

I am developing a Windows Form Application with several pages. I am using a TabControl to implement this. Instead of using the header to switch between tabs, I want my application to control this e.g. the next tab should open after the user has filled in a text box and clicked the next button.

10 Answers

This solution appears to work well - How to hide tabs in the tab control?

  1. Insert Tabcontrol into a form, the default name being tabcontrol1.

  2. Ensure that tabcontrol1 is selected in the Properties pane in visual studio and change the following properties:

    a. Set Appearance to Buttons

    b. Set ItemSize 0 for Width and 1 for Height

    c. Set Multiline to True

    d. Set SizeMode to Fixed

This is best done after your have finished your design time tasks as it hides them in the designer as well - making it difficult to navigate!

In my WinForms app, I was able to work around this by positioning the TabControl's y-coordinate outside the visible range of the form, so the tabs were effectively hidden. This example only works if the tabControl is near the top of the form, but you get the idea.

private void frmOptions_Load(object sender, EventArgs e)
{
    tabControl1.Top = -23; //Only tabPage contents visible
}
Related