Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Silverlight边界失败!_C#_Xaml_Silverlight 4.0 - Fatal编程技术网

C# Silverlight边界失败!

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

边界失败!! 我在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="#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%">