Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
i want to insert an image/picture box in my TabItem of Tabcontrol in wpf..
can any1 plz help me...
thanx in advance
Posted

If you want the image on the tab itself instead of the content area, something like this perhaps...

<tabitem>
    <tabitem.headertemplate>
        <datatemplate>
            <stackpanel orientation="Horizontal">
                <image source="Images/myimage.jpg" width="25" height="25" stretch="Fill" />
                <textblock text="Header Text" margin="5,0,0,0" />
            </stackpanel>
        </datatemplate>
    </tabitem.headertemplate>
    <!-- put tab content here ! -->
</tabitem>
 
Share this answer
 
Comments
Tarun.K.S 15-May-11 14:13pm    
Beautifully explained. 5+
<tabitem header="image" background="grey">
<image source="image.jpg" height="100" width="100">
</image></tabitem>

hope this might help you
 
Share this answer
 
Comments
Tarun.K.S 15-May-11 14:13pm    
That will do the trick. 5+

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