如何在wpf中的只读组合框中显示文本 [英] How to display text in read only combo box in wpf

查看:43
本文介绍了如何在wpf中的只读组合框中显示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在xaml中设置组合框属性IsEditable =False和Text =Test input

In xaml set the combobox property IsEditable="False" and Text="Test input"

推荐答案

您需要包含一个项目Test input并设置IsSelected =True例如
You need to include an item "Test input" and set IsSelected="True" e.g.
<ComboBox IsEditable="False" >
    <ComboBoxItem IsSelected="True">
        Test Input
    </ComboBoxItem>
</ComboBox>









有各种选择,而不是重新发明轮子我建议阅读以下链接的建议,并选择最适合您的应用程序的方法

SO Post 1 [ ^ ]



SO post 2 [ ^ ]


这篇关于如何在wpf中的只读组合框中显示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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