开发者

Specify a size for ContextMenu MenuItem Icon

I defined a WPF ContextMenu MenuItem Icon.

Now I see 开发者_运维技巧in this menu images(icons) of different sizes...

Could I explicitly set the icon size of this item?


Yes, you can specify the width and the heigth of your images :

<ContextMenu>
    <MenuItem>
        <MenuItem.Icon>
            <Image Width="50" Height="50" Source="..." />
        </MenuItem.Icon>
    </MenuItem>
    <MenuItem>
        <MenuItem.Icon>
            <Image Width="50" Height="50" Source="..." />
        </MenuItem.Icon>
    </MenuItem>
</ContextMenu>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜