tags:

views:

94

answers:

2

Hi,

I created a TabControl using Windows Forms but the tab headers look very ugly. I want to make them with rounded corners and also create some space between two tab headers. Can anyone please tell how it can be done using C#.

Thanks, gary

A: 

The System.Windows.Forms.TabControl class is just a wrapper around the Windows COMCTL32 tab control. Unfortunately, that control doesn't provide much in the way of customization options. You'll have to switch controls, either to WPF, custom code, or some third-party product.

ChrisV
+1  A: 

You'll want to do one of a few things:

  • Make your own custom control that inherits from TabControl and overrides its render method.
  • Download a third-party custom tab control that does what you want.
  • Switch to WPF, which gives you some more flexibility in the way of creating and styling controls.

There isn't a way to do this with System.Windows.Forms.TabControl out of the box, so you'll have to either live with what you've got, or roll your own.

Not to spark any heated debate, but WinForms is an aging API. If you're building a brand new application and/or learning a UI framework for the first time, you might consider using WPF instead. For legacy code, it's fine to maintain WinForms of course.

Ed Altorfer
Or you could just buy a Windows theme. It will however be worthless to a WPF app. Price of progress.
Hans Passant