Solved

Resize Silverlight with browser?

Posted on 2008-10-27
1
984 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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 my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 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