在 Silverlight 3 项目中,我在边框控件上使用鼠标左键按下事件,但发现即使在稍微超出边框(如 5-10 像素)单击按钮时也会引发该事件。
有没有人遇到过这个问题?
感谢期待!
以下是我们在其中捕获 brdSelect 事件的 XAML:
<Border MouseLeftButtonDown="Grid_Mousedown" x:Name="brdSelect" Grid.Row="1" Grid.Column="1" BorderThickness="0.5" BorderBrush="#FF2D9FD2">
<Grid x:Name="grdSelect" >
<Border x:Name="brdImage" BorderThickness="0" CornerRadius="5" Width="Auto" Height="Auto">
<Image Height="Auto" Width="Auto" Stretch="UniformToFill" x:Name="imgMotive"/>
</Border>
<Image Height="Auto" Stretch="UniformToFill" x:Name="imgtmp" Visibility="Collapsed"/>
</Grid>
</Border>
<Image Height="13" Width="13" Source="../Images/rotate_small.JPG" Stretch="None" x:Name="imgRotate" Grid.Row="0" Grid.Column="3" Visibility="Collapsed"/>
<StackPanel Orientation="Horizontal" d:LayoutOverrides="GridBox" Grid.ColumnSpan="3" Margin="0,0,2,0" Width="32" HorizontalAlignment="Left">
<Image Height="13" Width="13" Source="../Images/delete_small.JPG" Stretch="None" x:Name="imgDelete" Visibility="Collapsed" />
</StackPanel>
<Image Source="../Images/resize_small.JPG" Stretch="None" x:Name="imgResize" Grid.Row="2" Grid.RowSpan="2" Grid.Column="2" Visibility="Collapsed" Opacity="0"/>
</Grid>
<TextBlock x:Name="txtLabel" Height="100" HorizontalAlignment="Left" Margin="-80,0,0,-20" Width="80" Text="X: 0 --- Y: 0" Foreground="Red" TextWrapping="Wrap" Visibility="Collapsed"/>
</Grid>
</Border>