Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When i click image button the tab control will appear
how to do that in csharp
windows application
Posted
Comments
What have you tried?

1 solution

See this code

C#
public frmForm()
{
     InitializeComponent();
     tabControl1.Appearance = TabAppearance.Buttons;
     tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed;
     tabControl1.DrawItem += new DrawItemEventHandler(tabControl1_DrawItem);
}

private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
{
    //Load the image
    Image img = Image.FromFile(String.Format("{0}\\{1}.jpg",Application.StartupPath,tabControl1.TabPages[e.Index].Name));
    //Resize image
    img = new Bitmap(img, e.Bounds.Size);
    //Draw on Tab Button
    e.Graphics.DrawImage(img, e.Bounds.Location);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900