首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > CAD教程 >

silverlight 页面高度一直不变解决思路

2012-04-05 
silverlight 页面高度一直不变C# codeUserControl xmlns:sdkhttp://schemas.microsoft.com/winfx/2006/

silverlight 页面高度一直不变

C# code
<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"               x:Class="SLA_Fax.Views.SendFaxPage"    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"    mc:Ignorable="d"    d:DesignHeight="1000" d:DesignWidth="640">


设置了1000,可是不管用,一直就是那么高,也没有滚动条
内容都是基于grid网格的

[解决办法]
d:DesignHeight和d:DesignWidth是设计时高度,也就是在vs的设计窗口时见到的高度。
设置控件的高度的属性是Height,宽度是Width。
[解决办法]
另外试试使用在定义的时候不写宽和高,在第一层结构那定义宽和高呢,比如:
<UserControl x:Class="SilverlightVisio.Shapes.WorkFlowAttributesUC"
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"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
mc:Ignorable="d" 
>
 
<Grid x:Name="LayoutRoot" Background="White" Margin="2" Height="400" Width="280" >
</Grid>

热点排行