Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Resize Silverlight with browser?

Posted on 2008-10-27
1
Medium Priority
?
987 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

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…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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 video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

722 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