我们来看例子,下面的椭圆显示的将不是完整的一个椭圆。
Xaml 文件:
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="MySilverlight3StudyApplication.MainPage" Width="640" Height="480" mc:Ignorable="d"> <Ellipse Stroke="Black" StrokeThickness="10" Height="64" Margin="313,256,200,30" VerticalAlignment="Top" HorizontalAlignment="Left" Width="197"/> </UserControl>
执行效果如下图:
出现椭圆被劫了一部分的原因是 Margin="313,256,200,30" 在作怪。
Margin:获取或设置元素的外边距。上面的313,256,200,30 依次是 left,top,right,bottom
上面的右边距X坐标是通过下面算出来的 640(父控件宽度)-200(right Margin) = 440。 而正常椭圆的最右边点的X坐标为 313(left Margin)+10(left StrokeThickness)+197(Ellipse Width)+10(right StrokeThickness)= 530。
由于椭圆的最右边已经在 计算出来的右边距之外了,在之外的部分就没有显示,所以就会有上面的情况发生。
打印 | 张贴于 2009-12-11 18:11:40 | Tag:.Net 4.0
留言反馈
The cheap nike fusion black white bean released on January 2010 has been a hit with celebrities in the hip hop musics in the jordan air shoes The most popular celebrity commonly seen in this brand of Air Jordan shoe is Musician Lily Allen. The Jordan Air Retro were equipped with a double stack Air jordan Sole unit in the heel combined with a full length zoom air and bag.The most comfortable Air Jordan Retro ever released.Material used Air Jordan 19 cheap air jordansnever associated shoe wear design before. 5 air jordan retro 6,air jordan retro 6 air jordan retro 7,air jordan retro 7 air jordan 6 rings,air jordan 6 rings Air jordan spike For Sale,Air jordan spike For Sale Air jordan 23 For Sale,Air jordan 23 For Sale Air jordan 28 For Sale,Air jordan 28 For Sale Air jordan 9.5 For Sale,Air jordan 9.5 For Sale Cheap Jordan DMP,Cheap Jordan DMP Chaap Nike boot,Chaap Nike boot Cheap Air Jordan shoes,Cheap Air Jordan shoes Air Jordan Fusion 22,Air Jordan Fusion 22 Jordan Trunner Q4,Jordan Trunner Q4