Home > Silverlight > Determining Height and Width of Browser’s content window

Determining Height and Width of Browser’s content window

Hi,
One of the requirement people often have is to show child window which is of size of Browser’s content window Width and Height. Here each browser maintain its own browser width and client. So by default Silverlight provide browser height and width of host by using following code

Application.Current.Host.Content.ActualHeight => Height
Application.Current.Host.Content.ActualWidth => Width

But some times ActualHeight and ActualWidth doesnot give up actual values .
Use the below property to get the height width of host apps.
double height = double.Parse(HTMLPage.Document.Body.GetProperty(“clientHeight”).ToString());

double width=double.Parse(HtmlPage.Document.Body.GetProperty(“clientWidth”).ToString());

-Mahender

“As always please enter your comments”

Advertisements
Categories: Silverlight
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: