Solved

Resize Silverlight with browser?

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Enable Clear Text in Win 8.1 7 36
Need example 5 100
Slow process to read Excel 15 99
SSIS 2010 Convert to SSIS 2013 On Different Box 3 47
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

11 Experts available now in Live!

Get 1:1 Help Now