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