Microsoft Developer Network > 포럼 홈 > Visual Basic General > Tabcontrol (imageindex etc), how to set the image to the right of the text?
질문하기질문하기
 

답변됨Tabcontrol (imageindex etc), how to set the image to the right of the text?

  • 2007년 5월 4일 금요일 오후 12:22Andeplane 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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

답변

  • 2007년 5월 10일 목요일 오전 3:36Bruno YuMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    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.

     

모든 응답

  • 2007년 5월 10일 목요일 오전 3:36Bruno YuMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    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.

     

  • 2007년 12월 5일 수요일 오전 9:18jayanthan.s 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     


    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.