Tabcontrol (imageindex etc), how to set the image to the right of the text?
- I have a tabcontrol, and i have set a imagelist for this tab. I want to have an image (like firefox, IE etc) to close each tab.
I have managed to get an image there (with imageindex on each tabpage), but the image is to the left for the text. So I guess the question is;
How do I set the image to be on the right side of the text of each tabpages' tab?
How do I get into the on_click on the images? (to close the tab)
Anders Hafreager
Answers
Andeplane,
I hope the following thread can help you with the problem:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=570056&SiteId=1
The first thing to do is to set the TabControls DrawMode to OwnerDrawFixed as shown above.
You will of course also need to assign the DrawItem event to the tabControl1_DrawItem() method. Click the lightning bolt in the properties window and after selecting the tabcontrol, click on the dropdown arrow of the DrawItem event so that you can make the association.
This will only color the tabs. The problem you have is that you want a specific appearance for tabs, and that is a lot of work.
Setting the TabControl to OwnerDraw will only allow you to custom Draw the Tab Content. The outline of the tabs will still be drawn by the control.
From what I understand, you wish to use bitmaps to draw the tabs. To achieve this you will need to use the second example on my site as a base, but there will still be a fair amount of work to do afterwards.
All Replies
Andeplane,
I hope the following thread can help you with the problem:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=570056&SiteId=1
The first thing to do is to set the TabControls DrawMode to OwnerDrawFixed as shown above.
You will of course also need to assign the DrawItem event to the tabControl1_DrawItem() method. Click the lightning bolt in the properties window and after selecting the tabcontrol, click on the dropdown arrow of the DrawItem event so that you can make the association.
This will only color the tabs. The problem you have is that you want a specific appearance for tabs, and that is a lot of work.
Setting the TabControl to OwnerDraw will only allow you to custom Draw the Tab Content. The outline of the tabs will still be drawn by the control.
From what I understand, you wish to use bitmaps to draw the tabs. To achieve this you will need to use the second example on my site as a base, but there will still be a fair amount of work to do afterwards.
how do i load an image inside a tabitem of tabcontrol???? my tabitem has a grid and i replaced it with viewbox and tried to add an image but i could not able to include,could any one help me out of this issue!!!thanks in advance.


