58.3 F
Los Angeles
Tuesday, April 23, 2024

Trump Lawyer Resigns One Day Before Trial To Begin

Joseph Tacopina has filed with the courts that he will not represent Donald J. Trump. The E. Jean Carroll civil case is schedule to begin Tuesday January 16,...

Judge Lewis A. Kaplan Issues Order RE Postponement

On May 9, 2023, a jury found Donald J. Trump liable for sexual assault and defamation. The jury awarded Ms. Carroll $5 million in damages. Seven months ago,...

ASUS Announces 2023 Vivobook Classic Series

On April 7, 2023, ASUS introduced five new models in the 2023 Vivobook Classic series of laptops. The top laptops in the series use the 13th Gen Intel® Core™...
StaffIncremental BloggerResizing a Silverlight control speed bump

Resizing a Silverlight control speed bump

I’m trying to resize a Silverlight control on the fly. I’m using the code from this MSDN page.

Unfortunately in IE 7 I’m getting a size of zero for the Silverlight control’s actualwidth/actualHeight dimensions in the loaded event. This only happens in IE 7. In Firefox, I’m getting the correct size. Hmmm.

MSDN suggests the following code to set the original size to:

// Retrieve a reference to the control.
var control = sender.getHost();

// Do initial layout of the app based on initial size.
updateLayout(control.content.actualWidth, control.content.actualHeight);

Unfortunately, this gives a size of zero in IE in the loaded event.

To get around this I use:

var silverlightObj = document.getElementById(“silverlightObj”);
updateLayout(silverlightObj.clientWidth, silverlightObj.clientHeight);

Seems to work in IE and Firefox. I need to test in Safari.

Loren
Lorenhttp://www.lorenheiny.com
Loren Heiny (1961 - 2010) was a software developer and author of several computer language textbooks. He graduated from Arizona State University in computer science. His first love was robotics.

Latest news

Related news