Skip to main content
Home Forums General Silverlight Getting Started Resizing Silverlight screen according to screen resolution
5 replies. Latest Post by ssenthil on July 3, 2009.
(0)
Cute_Raj
Member
31 points
58 Posts
07-02-2009 8:02 AM |
Hi,
I am creating a web application where I am using silverlight as full screen mode. So I want to resize all the controls inside the page according to the screen resolution. Say if I see this page in mobile device then according to the screen resolution page size should be shrinked
Right now I am using scrollviewer for all the page. I don't know how to create a page like this.
Please help me
Krasshirsch
Participant
1032 points
300 Posts
07-02-2009 12:54 PM |
You should download the Silverlight Control Kit from CodePlex.
There you will find a Viewbox. Put your LayoutRoot inside a Viewbox, if you change the size of the Viewbox, the content will scale accordingly.
07-03-2009 12:03 AM |
Thanks for your valuable answer. But I am facing one more problem, I want to show my silverlight application in a full screen mode. But while testing seeing this page there are few spaces between the application and it is not occupying the whole screen.
I tried using
void Content_Resized(object sender, EventArgs e) { Application.Current.Host.Content.IsFullScreen = true; } void ViewBoxPage_LayoutUpdated(object sender, EventArgs e) { Application.Current.Host.Content.IsFullScreen = true; }
but no use.I am developing this application on Laptop and the screen resolution is 1280X800.
So what should I need to do?
ssenthil
487 points
106 Posts
07-03-2009 12:45 AM |
Hi
you can try like this
Add below event in your page constructor
and add definition
{
}
So that while resizing browser your controls will not go off, control size will reduce automattically
07-03-2009 1:50 AM |
Thanks Senthil. It really works. Thanks a lot!
07-03-2009 2:05 AM |
Thanks Raj....