56.5 F
Los Angeles
Saturday, December 2, 2023

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™...

Airman Arrested In Case of Leaked Classified Documents

Massachusetts Air National Guardsman Jack Teixeira has been arrested in the latest case of leaked classified documents. Teixeira, 21, is the head of Thug Shaker Central, an online gaming...

Microsoft OneNote to Gain Copilot

Microsoft 365 Copilot is coming to OneNote.
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