wpf 如何让按钮内容在WPF中垂直显示?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15795136/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 08:27:32 来源:igfitidea点击:
How to make the button content display vertically in WPF?
提问by fork123x
回答by Adolfo Perez
Very easy, use LayoutTransformand RotateTransform:
非常简单,使用LayoutTransform和RotateTransform:
<ToggleButton Content="Members Info" HorizontalAlignment="Right"
Click="btn_MembersInfo_Click">
<ToggleButton.LayoutTransform>
<RotateTransform Angle="-90" />
</ToggleButton.LayoutTransform>
</ToggleButton>
回答by paparazzo
Will need to adjust Width Height and Center
需要调整宽度高度和中心
<Button Content="RotatedButton" Width="200" Height="100">
<Button.RenderTransform>
<RotateTransform CenterX="0" CenterY="0" Angle="90" />
</Button.RenderTransform>
</Button>


