0

enter image description here

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

GorillaApe
  • 3,611
  • 10
  • 63
  • 106
  • You should really post your xaml for the button and the xaml containing the button. – hyp Jul 15 '11 at 11:01
  • Updated with xaml code.. – GorillaApe Jul 15 '11 at 12:01
  • Not much there to cause a problem... does this happen on every button or only on some? If only on some then have a look at the layout controls wrapping the buttons. – hyp Jul 15 '11 at 12:27
  • it happens not always at that machine... – GorillaApe Jul 15 '11 at 13:14
  • As wpf is rendered by DirectX then, if you've got at least some access to that pc, I would say try updating the graphics drivers and re-installing DirectX – hyp Jul 15 '11 at 13:44

0 Answers0