在wpf中以编程方式在toolbartray中添加工具栏 [英] Adding toolbar in toolbartray progarmmatically in wpf

查看:912
本文介绍了在wpf中以编程方式在toolbartray中添加工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi
如何以编程方式在工具栏托盘中添加工具栏?

Hi How can I add a tool bar in tool bar tray programmatically?

ToolBarTray tray = new ToolBarTray { Orientation = Orientation.Vertical };
ToolBar toolbar = new ToolBar() { Width = double.NaN, Height = double.NaN};
          
Button btnViewDetails = new Button() { Width = 200, Height = 30, Content = "View Details" };
Button btnAddModule = new Button() { Width = 200, Height = 30, Content = "Add Module" };
Button btnRemoveModule = new Button() { Width = 200, Height = 30, Content = "Remove Module" };
Button btnSendCommunication = new Button() { Width = 200, Height = 30, Content = "Send Communication" };

toolbar.Items.Add(btnViewDetails);
toolbar.Items.Add(btnAddModule);
toolbar.Items.Add(btnRemoveModule);
toolbar.Items.Add(btnSendCommunication);
toolbar.Band = 0;

//adding toolbar into tray

推荐答案

我的博客主题是:

http://www.global-webnet.com/blog/post/2014/11/14/ToolBarTray-Programmatically-adding- ToolBars-(PrismMEF).aspx [ ^ ]
I blog on the topic:
http://www.global-webnet.com/blog/post/2014/11/14/ToolBarTray-Programmatically-adding-ToolBars-(PrismMEF).aspx[^]


这篇关于在wpf中以编程方式在toolbartray中添加工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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