autosizing to fit monitor
Last post 05-11-2008 5:05 AM by reynaldor. 2 replies.
Sort Posts:
05-08-2008 12:18 AM
autosizing to fit monitor

Hi,

 I have searched the archives, but no one else seems to have the problem I am having.  I want the screen to fill the browser for a silverlight application.  When I select auto for the size, it makes it shink to a small dot in the IDE.  If I set it to 640x480 (or whatever) it seems to do that.  If I make sure no height and width properties are set in the XAML the screen still shrinks to very small size.  If I put a button on the screen, it will shrink to the size of the button.

Any ideas as to why I am having this problem with autosizing the application to fit the screen?  Autosize seems to work for everything else (assuming I hard code my size at the top level.)  except at the top level.

Thanks,

talldaniel

Joined on 08-28-2007
Posts 2
05-08-2008 9:17 AM
Marked as Answer
Re: autosizing to fit monitor

you need to change the height and the width of the UserControl to Auto

and set the HorizontalAlignment and VerticalAlignment of your LayoutRoot element to Stretch

 like this:

 

<UserControl x:Class="DataGridTest1.page2"

    xmlns="http://schemas.microsoft.com/client/2007"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Width="300" Height="300"  >

 

    <Grid x:Name="LayoutRoot" Background="Red" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

</Grid>

</UserControl>

 

Mohammad Shahrouri. 

tornado538

Joined on 12-09-2007
Amman- Jordan
Posts 3
05-11-2008 5:05 AM
Marked as Answer
Re: autosizing to fit monitor

Do you try remove de Width & Height properties. I already try this and works fine.

reynaldor

Joined on 05-11-2008
Posts 2