tags:

views:

421

answers:

2

Hi I want to put background image from tabcontrol in c# winforms. How can i change it?

A: 

You can't put a background image on the TabControl itself ; the TabControl.BackgroundImage property exists, but has no effect.

However you can put a background image on a page of the TabControl :

tabControl1.TabPages[0].BackgroundImage = Image.FromFile(fileName);
Thomas Levesque
Interesting that it has a BackgroundImage property that doesn't work. Begging to be extended.
Jon
That's because this property is defined in the `Control` class, and `TabControl` inherits from `Control`. But it makes no sense for `TabControl`, since its background will be hidden by the `TabPages` anyway. On `TabControl`, the property is hidden in designer and Intellisense.
Thomas Levesque
A: 

Have a look at this CodeProject post: http://www.codeproject.com/KB/dotnet/CustomTabControl.aspx

gsharp