组合框中的默认文本 [英] Default text in combobox

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

问题描述

我有2个组合框像在图像上,并想知道是否可以设置某种类型的文本字段的组合框(所以第一个框将状态成员)。这样我想摆脱上面的组合框的文本框。

I have 2 comboboxes like on the image and would like to know if it is possible to set some kind of text field for the combobox (so the first box would state Members). This way I would like to get rid of the textboxes above the comboboxes.

>

我知道这可以通过添加成员到数据集,但我不想这样做。有其他方法吗?

I know this can be done by adding the "Members" to the dataset but I donøt want to do that. Is there another way?

BR

推荐答案

寻找被称为水印,这可以通过如下面的问题中描述的值转换器来实现:

The effect you are looking for is called a 'watermark', this can be achieved with a value converter as described in the following questions:

WPF中的水印文本框

如何显示默认文字 - 选择小组 - 在WPF的pageload上的组合框中?

或通过博客文章中描述的行为:

Or via a behaviour, as described in the blogpost:

http://pwlodek.blogspot.com/ 2009/11 / watermark-effect-for-wpfs-textbox.html

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

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