tags:

views:

59

answers:

5

I'm suspecting the answer is no, but I just want confirmation before I move on - is there any easy way (as in, not re-templating) to hide things like the box that gets checked on a CheckBox, the drop-down arrow of a combo box, etc. without hiding the actual content being displayed?

+1  A: 

You can play some around with the Background or BorderBrush, but the answer is as you excepted: No..

You will need to restyle the control, but don't let the whole styling and templating scare you though.. Its actually quite easy once you get the hang of it ;)

Arcturus
A: 

the simplest way to display the content of ComboBox, CheckBox, etc. is to display a TextBlock in readonly mode.

You can easily make an UserControl with a DependencyProperty and show/hide your content.

Zied
A: 

You can create a very easy custom control to get what you need. for example for the checkbox, you can create a UserControl which have a checkbox with empty content and a textblock which contains your actual checkbox's text. this way you can simply usetriggers to hide the checkbox any time you want without altering its text. you can use this technic for combobox and others too.

Nima Rikhtegar
A: 

You can disable the control/s in which case they cannot be interacted with but the text is still displayed.

John K
Yes, but the actual circle for a radio button, or the drop-down arrow for a combo box will still be displayed.
Adam S
True, my answer is a compromise, likely one you already knew about. I do wonder why go to the extent of customization for something so trivial in context of the main app, unless you've found a special case where you need to splice the concept of disablement and hiding in the same control.
John K
A: 

Notice that you can have a checkbox like button using "ToggleButton", so you could use more or less use the same template as for your normal buttons (if you need them for toggling states).

The answer is YES, as you can actually template all controls a lot, without the need of creading custom controls. Just set the template in a style and add the style to the control.

oh i just reread your question .. the answer is NO, but have a look at the toggle button maybe its what you are looking for.

SwissCoder