Sdílet prostřednictvím


OnResize (Silverlight Plug-in Object)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Specifies a handler for the Resized event that occurs when the Silverlight plug-in's object tag is resized and the ActualHeight or the ActualWidth of the Silverlight plug-in change.

Syntax

object Element

<object ...>
  <param name="onresize" value="functionname"/>
  ...
</object>

Silverlight.js

Not available.

JavaScript

silverlightObject.Content.OnResize = handlername;

COM

Not available.

Managed Code

Remarks

The Resized event occurs when the Silverlight plug-in is in embedded mode and the value of the ActualHeight or ActualWidth properties changes.

If a change in size of the Silverlight plug-in triggers the FullScreenChanged event, the Resized event does not occur. The Resized event also does not occur when the Silverlight plug-in is in full-screen mode.

In embedded mode, the plug-in displays in the Web browser window. In full-screen mode, the plug-in displays on top of all other applications.

NoteNote:

Silverlight does not support automatic layout of elements based on changes to the plug-in size. Applications must provide resize logic for when the plug-in size changes.

Handle the Resized event instead of the DOM Loaded event when you want to respond to changes to the plug-in size (as opposed to changes to the size of other elements in the HTML DOM). The values of the ActualHeight and ActualWidth properties of the Silverlight plug-in are not guaranteed to be set at the time that the Loaded event occurs. However, Resized occurs when the values of the ActualHeight or ActualWidth properties change, which includes when the plug-in first loads.

Arguments for a Resized Event Handler Function

sender

object

The Silverlight plug-in that raised the event.

args

Always null.