Search code examples
wpfwidthelementminimize

wpf minimize the width of a ToggleButton


Does anyone know a good way to minimize the width of a ToggleButton to only the width of the content plus padding? I've found 500 posts on how to make it stretch, but none for keeping it from stretching to fill the available space.


Solution

  • <ToggleButton 
        HorizontalAlignment="Left" 
        VerticalAlignment="Top" 
        Content="hurf" />
    

    Just tested, this is roughly the size of the content.