ComboBox ControlTemplate Drop Down Button

后端 未结 1 1165
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-15 02:21

I was wondering if anyone had an example of how to style/template a combobox to only show a button at its default initial state. Kind of like the DropDownButton gallery for

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 03:09

    Here's some sample code:
    Note that the ContentPresenter and PART_EditableTextBox have been commented out deliberately and they can be taken off from the template.
    Also, you may want to customize the appearance of togglebutton and the popup.

    
        
            
                
                    
                        
                    
                    
                    
                        
                            
                                
                            
                        
                    
                
            
        
        
                
                    First
                    Second
                    Third
                
        
    
    

    Code adapted from: Customizing the Appearance of an Existing Control by Creating a ControlTemplate

    0 讨论(0)
提交回复
热议问题