首页 新闻 会员 周边 捐助

wpfWebbroswer窗体的标题栏如何透明?

0
[已解决问题] 解决于 2018-01-26 08:23
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Yuyue.WPF.Themes">
    <ControlTemplate x:Key="WindowBaseControlTemplate" TargetType="{x:Type Window}">
        <Grid>
            <Border Background="#6699ff"
                    CornerRadius="6"
                    Opacity="0.2" />
            <Border x:Name="borderBg"
                    Margin="3"
                    Background="#4F535D"
                    CornerRadius="5"
                    >
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="28" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Border x:Name="TitleBar" CornerRadius="5,5,0,0">
                        <Grid Background="#FFFFFF">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Image HorizontalAlignment="Left" Source="{Binding TitleImageBrush, RelativeSource={RelativeSource TemplatedParent}}" />
                            <WrapPanel Grid.Column="1" HorizontalAlignment="Right">
                                <Button x:Name="btnMinimize" Style="{DynamicResource MinimizeButtonStyle}" />
                                <Button x:Name="btnMaximize" Style="{DynamicResource MaximizeButtonStyle}" />
                                <Button x:Name="btnClose" Style="{DynamicResource CloseButtonStyle}" />
                                <Button x:Name="btnClose1" Style="{DynamicResource MaximizeButtonStyle}" />
                                <Button x:Name="btnClose2" Style="{DynamicResource MaximizeButtonStyle}" />
                            </WrapPanel>
                        </Grid>
                    </Border>
                    <Grid x:Name="gridContent" Grid.Row="1">
                        <ContentPresenter />
                    </Grid>
                </Grid>
            </Border>
        </Grid>
    </ControlTemplate>

    <Style x:Key="WindowBaseStyle" TargetType="{x:Type Window}">
        <Setter Property="Template" Value="{StaticResource WindowBaseControlTemplate}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="WindowStyle" Value="None" />
    </Style>
</ResourceDictionary>
大da脸的主页 大da脸 | 初学一级 | 园豆:73
提问于:2018-01-23 11:16
< >
分享
最佳答案
0

试试AllowTransparency="True"

奖励园豆:5
dudu | 高人七级 |园豆:29333 | 2018-01-23 11:26
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册