7heViking
7heViking

Reputation: 7587

Default text in combobox

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.

enter image description here

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

Upvotes: 1

Views: 11164

Answers (1)

ColinE
ColinE

Reputation: 70160

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

Watermark / hint text / placeholder TextBox in WPF

How to display default text "--Select Team --" in combo box on pageload in WPF?

Or via a behaviour, as described in the blogpost:

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

Upvotes: 2

Related Questions