views:

732

answers:

3

I have a 800x600 screen resolution silverlight application.When i use the code to make it full screen, ( i have current screen resolution of 1280x1024) it shows white background around my 800x600 black box.

i tried changing canvas background color and UserControl background color property but no effects.

is there any way to change the background color in full screen mode ?

A: 

I'm assuming that you're hosting the control on an aspx page?

Have you tried setting BackColor on the Silverlght control?

<asp:Silverlight ID="slControl" BackColor="Black" runat="server" Source="~/ClientBin/TestApp.xap" MinimumVersion="2.0.31005.0" Width="800" Height="600" />
TreeUK
Thank you for the answer, but i already have aspx page body background color = black.
bugBurger
A: 

You have to set the silverlight control to use up all the space of the page. Set the Width and Height properties to Auto. Then the background will be set for the whole displayed page. To know how to center the resulting control there are enough answers on this site.

R4cOON
A: 

You can also add a param to set the background, example:

<div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
          <param name="source" value="ClientBin/FooBar.xap"/>
          <param name="background" value="#4F4E4C" />
          <param name="minRuntimeVersion" value="3.0.40624.0" />
          <param name="autoUpgrade" value="true" />
          <param name="initParams" value="<%=InitParams %>" />
          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40624.0" style="text-decoration:none">
              <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
        </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
</div>
moonlightdock