Archive for August, 2011

Determining Height and Width of Browser’s content window

August 11, 2011 Leave a comment

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());


“As always please enter your comments”

Categories: Silverlight
%d bloggers like this: