简体   繁体   English

如何使用WPF创建自定义功能区控件?

[英]How can I create a custom Ribbon control with WPF?

I want to be able to add a DatePicker to one of my Ribbon's tabs and have the space and size managed by the Ribbon . 我希望能够将DatePicker添加到我的Ribbon的一个选项卡中,并具有由Ribbon管理的空间和大小。 Particularly, I want to create a custom Ribbon control that will have a Ribbon control Label attribute available. 特别是,我想创建一个自定义的Ribbon控件,该控件将具有Ribbon控件的Label属性可用。 I'm not sure how to solve this without multiple inheritance (inheriting from DatePicker and RibbonControl ). 我不确定如何在没有多重继承的情况下解决此问题(继承自DatePickerRibbonControl )。

Is there a RibbonControl interface that will grant me access to the Label attribute of the control without having to define custom formatting? 是否存在RibbonControl接口,该接口可以授予我对控件的Label属性的访问权限,而无需定义自定义格式? Will I have to abandon the ribbon and create a custom tabbed interface instead? 我将不得不放弃功能区,而是创建一个自定义选项卡式界面吗?

I dont know why you would like to create a custom ribbon, whether you want a ribbon with which you could interact. 我不知道您为什么要创建自定义功能区,是否想要与之交互的功能区。 i am proving you a link here, you could download the source code and modify it as you want. 我在这里向您证明了一个链接,您可以下载源代码并根据需要对其进行修改。 here it show they have added a drop down list. 这里显示他们已经添加了一个下拉列表。 you could add a date picker too. 您也可以添加日期选择器。 http://www.codeproject.com/Articles/23199/WPF-C-Ribbon-Control-Library http://www.codeproject.com/Articles/23199/WPF-C-Ribbon-Control-Library

if it helps you. 如果有帮助的话。 you are welcome in advance 提前欢迎您

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM