开发者

SilverLight Auto-Size Help?

I'm new to using SilverLight and I added a grid to the screen, and both sizes are se开发者_如何学Clected to auto, but for some reason it doesn't fill up the screen. I'm using Visual Studio 2010, Silverlight 3.0

I did the exact same thing with two grids earlier and it works perfect

Here's the code:

<Grid Height="75" HorizontalAlignment="Left" Name="grid2" VerticalAlignment="Top" Background="White">
    <Image Height="74" HorizontalAlignment="Left" Name="image1" Stretch="None" VerticalAlignment="Top" Source="test.jpg" />
</Grid>


Setting HorizontalAlignment and VerticalAlignment properties to Stretch and Width, Height to Auto should do the trick.


Is it just me, you've set the height explicitly in your grid and your image?

I'm no expert, but from my experience if you don't put anything for width it normally fills the parent.

I also notice there are no Row or column definitions, nor are there any Grid.Row, grid.Column dependency properties, is that just something in they way you copied the code?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜