更改 GroupBox 标题位置 [英] Change GroupBox Header location
本文介绍了更改 GroupBox 标题位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下 GroupBox
,其文本位于控件的边框上.目前,文本一半在控件内,一半在控件外.
I have the following GroupBox
whose text sits on the border of the control. Currently, half of the text is inside and half is outside the control.
如何将其移动到完全位于控件内?
How can I move it to sit completely inside the control?
<GroupBox Grid.Row="2" Background="LightSteelBlue">
<GroupBox.Header>
<Label FontSize="15"
VerticalAlignment="Bottom"
FontFamily="Calibri"
FontWeight="ExtraBold">Traceability Data</Label>
</GroupBox.Header>
</GroupBox>
推荐答案
像这样向标签添加边距或内边距:
Add a margin or padding to your label like this:
<GroupBox Grid.Row="2" Background="LightSteelBlue" Margin="0,-20,0,0" >
<GroupBox.Header>
<Label FontSize="15" VerticalAlignment="Bottom" FontFamily="Calibri" Padding="0,20,0,0" FontWeight="ExtraBold">Traceability Data</Label>
</GroupBox.Header>
</GroupBox>
填充似乎提供了更好的结果.
Padding seems to give a better results.
这篇关于更改 GroupBox 标题位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文