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

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

问题描述

我有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.

我知道这可以通过添加成员的数据集,但我DONOT想这样做来完成。有另一种方式?

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

如何显示默认的文字和QUOT; - 选择团队 - "在WPF中页面加载组合框

通过行为,如博文中描述?或:

Or via a behaviour, as described in the blogpost:

http://pwlodek.blogspot.com/ 2009/11 /水印效果换wpfs-textbox.html

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

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