Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using tab and problem is that. when i use the tab button in the alignment property left then text dusplayed is not horizontally it is showing vertical text(button name of tab)
so i decided to show a image on tab button but the problem is there is nothing such option.
so what can i do here?
Posted

1 solution

 
Share this answer
 
Comments
shaikh-adil 5-Dec-12 2:43am    
nice sir
thanks
and if i want to change the image of the tab button i mean. The image key to another image in the image list. When the user clicks the tab button the image should b changed to another image and if i tab is deselected then restore to orignal image.
I know that it should be done through events but the problem is i dont know the code how to set the image programmatically and which event will b fire for changing?
Can you help me sir
ridoy 5-Dec-12 11:21am    
I can give you an idea.then try to do it.you can use mouseEnter and mouseLeave event to do this.when you mouse over on you tab you need to change the image source by code and when you leave mouse from there you need to set previous image.Below is a link where it is done in case of a button..i expect you can do it for a tab button...
http://stackoverflow.com/questions/2554241/how-to-change-button-background-image-on-mouseover
shaikh-adil 6-Dec-12 9:22am    
sir i have made this code but the problem is it doesnt change the tabbutton's background it changes the tab's background
tabPage4.BackgroundImage = Properties.Resources.sc;
CHill60 6-Dec-12 11:00am    
Have another look at the link ridoy pasted earlier ... http://stackoverflow.com/questions/4019888/how-do-you-add-a-image-to-a-tab-label
and combine that with some code in the SelectedIndexChanged event to change the ImageIndex of the selected tabpage
ridoy 6-Dec-12 12:23pm    
i think CHill60 is absolutely right.

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