奇怪的显示问题是随机发生的,其中按钮的部分显示或“重影”将出现在画布上。
应该有一个“6”和“7”的按钮。 “Welco”不应该在那里
编号按钮是wpf按钮,右边的4是telerik radbuttons。
99%的时间,显示正常。它只是在随机的时间,任何按钮点击,显示可能会搞砸。我可以最小化/最大化,显示变得正常。我使用Snagit捕获附加图像,然后最小化捕获图像。那时显示正常。所以我认为这不一定是xaml中引起这种情况的东西。
这里是否有内存问题,不允许正常显示?
感谢您提供任何帮助或建议。
XAML:
<Canvas x:Name="canvasTop" Background="#FFFFFF" HorizontalAlignment="Stretch" Height="74" VerticalAlignment="Top" Margin="0,26,0,0" Grid.ColumnSpan="2">
<StackPanel x:Name="pnlSteps" >
<StackPanel x:Name="pnlStepProcess" Orientation="Horizontal" HorizontalAlignment="Left" Margin="250,10,0,10">
<StackPanel.Resources>
<Style TargetType="{x:Type Label}">
<Setter Property="Background" Value="LightGray" />
</Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Foreground" Value="#3C2F56" />
<Setter Property="Background" Value="LightGray" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
</StackPanel.Resources>
<Button x:Name="btnStep1" Width="22" Click="Step1Click" Height="22" Cursor="Hand" >
<Button.Template>
<ControlTemplate>
<Border CornerRadius="0" Height="21" Background="{TemplateBinding Background}">
<TextBlock
HorizontalAlignment="Center"
Height="20"
FontSize="14">
<AccessText>_1</AccessText>
</TextBlock>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
<Label x:Name="lineA" HorizontalAlignment="Left" Height="4" Width="100" />
<Button x:Name="btnStep2" Width="22" Click="Step2Click" Height="22" Cursor="Hand" >
<Button.Template>
<ControlTemplate>
<Border CornerRadius="0" Height="21" Background="{TemplateBinding Background}">
<TextBlock
HorizontalAlignment="Center"
Height="20"
FontSize="14">
<AccessText>_2</AccessText>
</TextBlock>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
<Label x:Name="lineB" HorizontalAlignment="Left" Height="4" Width="100" />
<Button x:Name="btnStep3" Width="22" Click="Step3Click" Height="22" Cursor="Hand" >
<Button.Template>
<ControlTemplate>
<Border CornerRadius="0" Height="21" Background="{TemplateBinding Background}">
<TextBlock
HorizontalAlignment="Center"
Height="20"
FontSize="14">
<AccessText>_3</AccessText>
</TextBlock>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
<Label x:Name="lineC" HorizontalAlignment="Left" Height="4" Width="100" />
<Button x:Name="btnStep4" Width="22" Click="Step4Click" Height="22" Cursor="Hand" >
<Button.Template>
<ControlTemplate>
<Border CornerRadius="0" Height="21" Background="{TemplateBinding Background}">
<TextBlock
HorizontalAlignment="Center"
Height="20"
FontSize="14">
<AccessText>_4</AccessText>
</TextBlock>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
<Label x:Name="lineD" HorizontalAlignment="Left" Height="4" Width="100" />
<Button x:Name="btnStep5" Width="22" Click="Step5Click" Height="22" Cursor="Hand" >
<Button.Template>
<ControlTemplate>
<Border CornerRadius="0" Height="21" Background="{TemplateBinding Background}">
<TextBlock
HorizontalAlignment="Center"
Height="20"
FontSize="14">
<AccessText>_5</AccessText>
</TextBlock>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
<Label x:Name="lineE" HorizontalAlignment="Left" Height="4" Width="100" />
<Button x:Name="btnStep6" Width="22" Click="Step6Click" Height="22" Cursor="Hand" >
<Button.Template>
<ControlTemplate>
<Border CornerRadius="0" Height="21" Background="{TemplateBinding Background}">
<TextBlock
HorizontalAlignment="Center"
Height="20"
FontSize="14">
<AccessText>_6</AccessText>
</TextBlock>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
<Label x:Name="lineF" HorizontalAlignment="Left" Height="4" Width="100" />
<Button x:Name="btnStep7" Width="22" Click="Step7Click" Height="22" Cursor="Hand" >
<Button.Template>
<ControlTemplate>
<Border CornerRadius="0" Height="21" Background="{TemplateBinding Background}">
<TextBlock
HorizontalAlignment="Center"
Height="20"
FontSize="14">
<AccessText>_7</AccessText>
</TextBlock>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</StackPanel>
<!--<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="600,0,0,0">-->
<StackPanel Orientation="Horizontal" Canvas.Right="10" >
<telerik:RadButton x:Name="btnMessages" Click="btnMessages_Click" Background="Transparent" Height="40" Width="50" BorderBrush="{x:Null}" Margin="100,0,0,0"
Template="{DynamicResource RadButtonControlTemplate2}" >
<StackPanel Orientation="Horizontal">
<Image Source="" ToolTip="" Height="22" Width="50" />
</StackPanel>
</telerik:RadButton>
<telerik:RadButton x:Name="btnSettings" Background="Transparent" Height="40" Width="50" BorderBrush="{x:Null}" Margin="10,0,0,0" Template="{DynamicResource RadButtonControlTemplate2}">
<StackPanel Orientation="Horizontal">
<Image Source="" ToolTip="" Height="25" Width="50" />
</StackPanel>
</telerik:RadButton>
<telerik:RadButton x:Name="btnHelp" Background="Transparent" Height="40" Width="50" BorderBrush="{x:Null}" Margin="10,0,0,0" Template="{DynamicResource RadButtonControlTemplate2}">
<StackPanel Orientation="Horizontal">
<Image Source="" ToolTip="Help with application" Height="25" Width="50" />
</StackPanel>
</telerik:RadButton>
<telerik:RadButton x:Name="btnExit" Click="btnQuit_Click" Background="Transparent" Height="40" Width="50" BorderBrush="{x:Null}" Margin="10,0,0,0" Template="{DynamicResource RadButtonControlTemplate2}">
<StackPanel Orientation="Horizontal">
<Image Source="" ToolTip="Close application" Height="25" Width="50" />
</StackPanel>
</telerik:RadButton>
</StackPanel>
<Label x:Name="lblWelcome" Width="439" HorizontalContentAlignment="Right" Height="30"
Foreground="#6B478E" FontSize="14" FontWeight="Bold" Canvas.Top="40" Canvas.Right="10" />