开发者

Is there any easy way to hide the radio buttons, checkboxes, etc. without hiding the content?

I'm suspecting the answer is no, but I just want confirmation before I move on - is ther开发者_运维知识库e 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?


Try this! Example is for a radio button:

radioButton.Visibility = Visibility.Hidden;


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 ;)


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜