【问题标题】:Centre the background of a TabControl in WPF在 WPF 中将 TabControl 的背景居中
【发布时间】:2010-12-21 23:00:54
【问题描述】:

我正在尝试让图像在我的 TabControl 中间不拉伸地浮动。 我从下面拉伸图像的 XAML 开始。

<TabControl>
    <TabControl.Background>
        <ImageBrush  ImageSource="/LogoTest;component/logo_final.png" />            
    </TabControl.Background>
</TabControl>

我尝试了各种方法,例如使用带有网格的 VisualBrush,但我无法获得所需的结果。

有没有我想念的简单方法?

【问题讨论】:

    标签: .net wpf image layout tabcontrol


    【解决方案1】:
    <ImageBrush 
        ImageSource="/LogoTest;component/logo_final.png" 
        AlignmentX="Center" AlignmentY="Center" 
        Stretch="None"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-30
      • 1970-01-01
      • 2016-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多