Visual Studios - WinForms工具条和WPF工具栏 [英] Visual Studios - WinForms Toolstrip and WPF Toolbar
本文介绍了Visual Studios - WinForms工具条和WPF工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何轻松地将图标文件添加到WPF中的工具栏?在我的winForms中,我只想进入工具条编辑器并从我的资源文件夹中添加图标。在WPF中,我似乎无法找到资源文件夹
How can I easy add icon file to a toolbar in WPF? In my winForms I would just go to the toolstrip Editor and add in icons from my Resource Folder. In WPF I can;t seem to find the Resource Folder
推荐答案
您好cmdolcet,
Hi cmdolcet,
您应该使用按钮并在WPF中添加一个Image控件:
You should use a button and add a Image control inside in WPF:
<DockPanel>
<ToolBarTray DockPanel.Dock="Top">
<ToolBar Height="30">
<Button>
<Image Source="C:\Users\v-baf\Desktop\Picture\1.jpg"/>
</Button>
<Button>
<Image Source="C:\Users\v-baf\Desktop\Picture\2.jpg"/>
</Button>
<Button>
<Image Source="C:\Users\v-baf\Desktop\Picture\3.jpg"/>
</Button>
</ToolBar>
</ToolBarTray>
</DockPanel>
问候,
Stanly
这篇关于Visual Studios - WinForms工具条和WPF工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文