WPF render glitches on WIN XP

你离开我真会死。 提交于 2019-12-13 05:25:28

问题


For example this button roundrectangle becomes like this sometimes! not always..

WPF on windows xp with 3.5sp1... Any solution for this?? On my machine works fine WIN7. I tried at XP had some problems with transparency when installed drivers no problem at all..
At another computer with XP also no problem reported... Only at one computer there is a problem but i dont know its configuration as it isnt mine..

<Style x:Key="ResultsButton" TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
            <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>

                            <Rectangle Stroke="Black" RadiusX="7" RadiusY="9" StrokeThickness="0">
                                <Rectangle.Effect>
                                    <DropShadowEffect Direction="281" Color="#FF5A5252" ShadowDepth="4"/>
                                </Rectangle.Effect>
                                <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop Color="#FFE5B210" Offset="1"/>
                                    <GradientStop Color="#FFE5B210" Offset="0.49"/>
                                    <GradientStop Color="#FFF18200" Offset="0.51"/>
                                    <GradientStop Color="#FFF18200"/>
                                </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>                


                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>                 


                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">

                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="true">

                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="#ADADAD"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

On

来源:https://stackoverflow.com/questions/6705887/wpf-render-glitches-on-win-xp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!