OnResize (Silverlight Plug-in Object)


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.

object Element

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


Not available.


silverlightObject.Content.OnResize = handlername;


Not available.

Managed Code

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.

Note Note:

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



The Silverlight plug-in that raised the event.


Always null.

Ajouts de la communauté