在WPF的Tabcontrol的TabItem中插入图像/图片框 [英] insert an image/picture box in my TabItem of Tabcontrol in WPF

查看:873
本文介绍了在WPF的Tabcontrol的TabItem中插入图像/图片框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在wpf中的 Tabcontrol TabItem 中插入图像/图片框..
any1 plz可以帮助我...
预先thanx

i want to insert an image/picture box in my TabItem of Tabcontrol in wpf..
can any1 plz help me...
thanx in advance

推荐答案

如果您希望标签上的图像本身而不是内容区域上的图像,则可能是这样的...

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>


< tabitem标头="image" background ="grey">
< image source ="image.jpg" height ="100" width ="100">
</image></tabitem>

希望这对您有帮助
<tabitem header="image" background="grey">
<image source="image.jpg" height="100" width="100">
</image></tabitem>

hope this might help you


这篇关于在WPF的Tabcontrol的TabItem中插入图像/图片框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆