Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
i want to use image in each tabpage in tab control.How will i use?
Please give me solution.







Thank you.
Posted

PictureBox?
myPictureBox.Image = Image.FromFile(path);

OnPaint?
e.Graphics.DrawImage(myImage, new Point(0,0));


It depends on what you are doing: Where you are getting info from, do you create your pages at design time, or run time?

What are you actually trying to achieve?
 
Share this answer
 
Comments
SURBHI TYAGI 29-Jul-11 5:11am    
i want to use image at the place of tab page.I have a tab control that hase some pages such as Accounts,Quality etc.I want to use somewhat account image at the place of Account text.
OriginalGriff 29-Jul-11 5:21am    
If you mean on the tab itself, beside the text saying "Accounts" then as Kim Togo says:
1) Add an ImageList to your form. Populate it with the images you need.
2) In the TabControl properties, set the ImageList to the list you just created.
3) In each TabPage, set the ImageIndex to the appropriate value: 0 for the first, and so forth. If you do this from the designer, it shows you the image as you do it.
You have to assign a ImageList to the TabControl and give each TabPage and ImageKey or ImageIndex.

TabControl.ImageList[^]
 
Share this answer
 
Comments
SURBHI TYAGI 29-Jul-11 5:21am    
oksss.............thanks.
Kim Togo 29-Jul-11 5:23am    
You are welcome.

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