是否有任何原生WPF多选组合框可用?

编程入门 行业动态 更新时间:2024-10-19 10:20:52
本文介绍了是否有任何原生WPF多选组合框可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

即使是第三方也可以。

感谢

推荐答案

p> WPF中没有本地多选择组合框。请检查我的博客一个简单的黑客使用表达式混合来实现多选择组合框。 jobijoy.blogspot/ 2009/02 / simple-multiselect-combobox-using.html 这个想法是通过编辑控件模板,使用ListBox的多选择功能到组合框中。

There is no native multiselect combobox in WPF. Please check my blog for a simple hack using expression blend to achieve a multi selection on combobox. jobijoy.blogspot/2009/02/simple-multiselect-combobox-using.html The idea is to utilize the Multi-Selection feature of ListBox in to ComboBox by editing the control template.

但是对于访问所选项目,您可能需要使用代码中的下划线。

But for accessing the selected items you might need to use the bellow line in the code.

((ListBox)cmbBox.Template.FindName("lstBox",cmbBox)).SelectedItems

其中 > cmbBox 是您的组合框, lstBox 是controltemaplate中的ListBox。

Where cmbBox is your combobox and lstBox is the ListBox inside the controltemaplate.

更多推荐

是否有任何原生WPF多选组合框可用?

本文发布于:2023-11-07 05:46:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565693.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组合   多选   有任何   WPF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!