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
2009-08-21 12:01:39
Interesting that it has a BackgroundImage property that doesn't work. Begging to be extended.
Jon
2009-08-21 12:50:01
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
2009-08-21 13:53:25
A:
Have a look at this CodeProject post: http://www.codeproject.com/KB/dotnet/CustomTabControl.aspx
gsharp
2009-08-22 08:13:07