WPF button change content size

  • A+
所属分类:.NET技术
摘要

Copy from https://social.msdn.microsoft.com/Forums/vstudio/en-US/188c196e-90d8-4584-bc62-38d7e008cf5c/how-do-i-resize-button-text-upon-button-resize?forum=wpf

<Button Name="button" Content="Hello" Height="100" Width="200" Click="button_Click_2">      <Button.ContentTemplate>          <DataTemplate>              <Viewbox>                  <TextBlock>MyButton</TextBlock>              </Viewbox>          </DataTemplate>      </Button.ContentTemplate>  </Button>

Copy from https://social.msdn.microsoft.com/Forums/vstudio/en-US/188c196e-90d8-4584-bc62-38d7e008cf5c/how-do-i-resize-button-text-upon-button-resize?forum=wpf