How can you add a button to the header of a TabPage?

2.7k views Asked by At

Similar to how browsers close tabs, I was wondering if you can add a button to the header of a TabPage.

Would it use a custom TabPage renderer

Would I be able to add a button on the tab itself

1

There are 1 answers

0
YOusaFZai On

You can find sample implementations here:

  1. A TabControl with tab page closing capability

  2. Implementing Close button in Tab Pages

  3. FireFox-like Tab Control

Basically, you will write code that draws the button in the appropriate place (e.g. by overriding the OnDrawItem function), and then write some more code that handles clicks of this button.