How can I get my UserControl to look like a ComboBox?

Posted by NoLuke on Stack Overflow See other posts from Stack Overflow or by NoLuke
Published on 2011-02-15T16:28:24Z Indexed on 2011/03/20 16:10 UTC
Read the original article Hit count: 174

Filed under:
|
|
|

I have a user control containing a TextBox, ToggleButton and Popup, just like the real ComboBox. Now my problem is to style it so that it looks just like the normal ComboBox.

In Blend, I can "Edit Template/Edit a Copy..." of a real ComboBox to get the bits and pieces I need to get it to look right. For one Windows theme (Aero). If the application is run on another theme (e.g Luna), the control does not change its look, it still has the Aero look.

Do I have to supply a style/template for each Windows theme, or can I somehow get hold of (at run-time) the default ComboBox style and apply it to my UserControl?

Instead of making a UserControl, I have tried modifying a real ComboBox to my needs, but I just couldn't get it to work. How can I replace ALL the logic of a ComboBox with my own?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about usercontrols