Search code examples
c#.netwpfwpfdatagrid

Content of button adapts size according to button?


I want to resize content within a button so that when I "resize" my window, buttons also gets resized but size of content within button remains unchanged?

What should I do in order to make contents resized WRT button size.

Thanks, Faisal

PS: I am using GRID layout in WPF. enter image description here


Solution

  • The easiest way that I can think of you doing that is for you to use a ViewBox element inside your Buttons:

    <Button>
        <ViewBox>
            <!--Your Button content--> 
        </ViewBox>
    </Button>