On the WPF TabControl - can I add content next to the tab headers?

前端 未结 2 1434
春和景丽
春和景丽 2020-12-28 19:19

Is there an easy way to position another control (i.e. a button) inline and to the right of tab headers in WPF?

In the web, I would use a float or absolute positioni

2条回答
  •  一个人的身影
    2020-12-28 19:57

    The robust way to do this is to re-template the TabControl as I did for the close button in my ActiveAwareCommand sample:

    
        
            
                
                
            
            
                
                
            
            
                
                    
                    
                
                
                
            
            
                
                    
                        
                    
                
            
        
    
    

    Notice how the TabPanel and Button can never overlap. Result:

    alt text

提交回复
热议问题