Tag Archives: add tabs

Remove tabs from a WPF TabControl at runtime in C#

The example Add tabs to a WPF TabControl at runtime in C# shows how you can add tabs to a control at runtime. You would think removing tabs would be easier, and it is in a way. You simply remove … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , , | Leave a comment

Add tabs to a WPF TabControl at runtime in C#

When you click the + button, this example uses the following code to add a tab to the WPF TabControl named tabMain. // Add a tab to the TabControl. private void btnAdd_Click(object sender, RoutedEventArgs e) { TabItem tab_item = new … Continue reading

Posted in controls | Tagged , , , , , , , , , , , , , | 1 Comment

Add tabs to a TabControl at runtime in C#

The post Make an improved owner-drawn TabControl in C# shows how to build an owner-drawn TabControl that lets the user remove tabs at runtime. This example lets you add tabs, too. The program includes a Label that displays an X. … Continue reading

Posted in controls | Tagged , , , , , , , , , , | 2 Comments

Make an improved owner-drawn TabControl in C#

The post Make an owner-drawn TabControl in C# shows how to make an owner-drawn tab control. Unfortunately the control behaves strangely if it’s not wide enough to display all of its tabs at once. If the control is too small … Continue reading

Posted in controls | Tagged , , , , , , , , , | 1 Comment

Make an owner-drawn TabControl in C#

This example shows a couple of techniques including how to make an owner-drawn TabControl and how to let the user close tabs at run time. The program uses the following Load event handler to get the TabControl ready for use. … Continue reading

Posted in controls | Tagged , , , , , , , , , | 1 Comment