Solved

Resize Silverlight with browser?

Posted on 2008-10-27
1
978 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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