0

I would like to add checkboxes to the place (don't know the formal name) where the text representing the tab appears. I am attaching a sample image of how I want it to look like:

enter image description here

Does anyone know how I might be able to achieve this? Feel free to use any .NET language that you are comfortable with - I can easily translate to what I need.

Denis
  • 11,796
  • 16
  • 88
  • 150
  • You can draw checkboxes in the TabPageHeaderRegion, but requires much changes to do this: custom painting, adding handler's, getting region's of the tabpages and etc... – Trevor Apr 13 '15 at 15:09

2 Answers2

1

If I had to do this now, I would code

  • A class "myTab inherits System.Windows.FormsTabControl".
  • Add a "Protected Overrides Sub WndProc" to capture the WM_PAINT message, in order to perform a custom paint.

But I would sure try things like that, before: WinForms TabControl - Add New Tab Button (+)

or

http://www.codeproject.com/Articles/91387/Painting-Your-Own-Tabs-Second-Edition

Community
  • 1
  • 1
Morcilla de Arroz
  • 2,104
  • 22
  • 29
  • This codeproject is a great example. I can work off of that! I guess all I need to do is create a style. – Denis Apr 13 '15 at 15:18
0

I am thinking a HACKEY way to do this is to use the escape character for "checked" checkbox and "unchecked" checkbox in the tab HEADER string. (Don't know if this will work yet). When the user's mouse is clicked on the "unchecked" checkbox character then change the character to a "checked" checkbox or vice versa. Just simulating the checkbox checked/unchecked visual. There must be a cleaner way to do this.

Denis
  • 11,796
  • 16
  • 88
  • 150