Solved

Resize Silverlight with browser?

Posted on 2008-10-27
1
975 Views
Last Modified: 2013-11-12
Hi, I'm very new to silverlight.

I'm trying to test some functionnalitites of silverlight and i was wondering if there's a way to display the silverlight web page to fill the entire browser?

If so you guys have any example? I'm also curious about making the page display in full screen.

Thanks for the help.
0
Comment
Question by:SESIT
1 Comment
 

Accepted Solution

by:
SESIT earned 0 total points
ID: 22830996
Ok i found the anwser to my question...

I found two solutions depending on what you want to do:

#1 If you want the app to only resize with the browser WITHOUT resizing the controls inside (no scale) you need to do this in your page.xaml.vb or . cs

#1 for VB: (in page.xaml.vb)

Public Sub New()
             InitializeComponent()

              AddHandler App.Current.Host.Content.Resized, AddressOf Content_Resized

End Sub

Private Sub Content_Resized(ByVal sender As Object, ByVal e As EventArgs)
              Me.Width = App.Current.Host.Content.ActualWidth
              Me.Height = App.Current.Host.Content.ActualHeight
End Sub


#1 for C#: (in page.xaml.cs)

public Page()

{
           InitializeComponent();

          App.Current.Host.Content.Resized += new EventHandler(Content_Resized);
}

void Content_Resized(object sender, EventArgs e)
{

           this.Width = App.Current.Host.Content.ActualWidth;
           this.Height = App.Current.Host.Content.ActualHeight;

}

Solution #2 Where you want the controls to be scale with the resizing of the browser

you need to define some scale transformations.

Follow this video for details:

http://www.microsoft.com/web/content.aspx?id=silverlight-content-resizing-html
 
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now