【问题标题】:get some text inside of border (WPF)在边框内获取一些文本(WPF)
【发布时间】:2022-08-03 10:03:03
【问题描述】:

我的WPF-Application 中有一个边框,我想在我的边框内有一些文本,如下图所示。

但我不知道该怎么做。

我现在的代码:

<Border Margin=\"10\" BorderThickness=\"5px\" BorderBrush=\"Gray\" CornerRadius=\"5\" Grid.Column=\"0\" Grid.Row=\"1\">
  <RadioButton Margin=\"5\">Test</RadioButton>
</Border>

谢谢你的帮助!

  • 为什么不自定义 GroupBox 周围的边框,它已经这样做了?
  • 这就是我需要的。我已经搜索和搜索但找不到任何东西,这是我整天搜索的东西。太感谢了!!!
  • @B0BBY 我已经回答了。如果您不介意,可以点击\'✔\'将我的回复标记为已接受答案。它还将帮助其他人解决类似的问题。

标签: wpf windows visual-studio


【解决方案1】:

您可以使用满足您需求的 GroupBox。

<Grid>
    <GroupBox  Margin="10">
        <GroupBox.Header>
            Some Text
        </GroupBox.Header>
        <TextBlock TextWrapping="WrapWithOverflow" Margin="10" Text="Happy every day!"/>
    </GroupBox>
</Grid>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-20
    • 1970-01-01
    • 2021-12-14
    • 1970-01-01
    • 1970-01-01
    • 2022-08-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多