C# Silverlight边界失败!
边界失败!! 我在XAML代码中有一个边框,在主画布之后定义:C# Silverlight边界失败!,c#,xaml,silverlight-4.0,C#,Xaml,Silverlight 4.0,边界失败!! 我在XAML代码中有一个边框,在主画布之后定义: <Canvas xmlns="http://schemas.microsoft.com/client/2007" ... VerticalAlignment="Top" HorizontalAlignment="Center"> <Border x:Name="JohnnyBorder" BorderThickness="1" Margin="0,0,0,0" BorderBrush="#FF67
<Canvas xmlns="http://schemas.microsoft.com/client/2007"
... VerticalAlignment="Top" HorizontalAlignment="Center">
<Border x:Name="JohnnyBorder" BorderThickness="1" Margin="0,0,0,0" BorderBrush="#FF677B8B" VerticalAlignment="Stretch"
HorizontalAlignment="Center">
但它不起作用。JohnnyBoarder的底线是比浏览器底部高出几个百分比。为什么?我认为在你周围有你的
边框
会自然得多画布
:
<Border>
<Canvas>
...
</Canvas>
</Border>
...
默认情况下,
边框
将填充页面,画布
将填充边框
承载silverlight应用程序的页面可能没有为silverlight应用程序提供100%的高度。检查承载silverlight应用程序的html或aspx文件,并确保其设置为100%高度
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">