Share via


Workbook.WindowResize Event (2007 System)

Occurs when any workbook window is resized.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
Public Event WindowResize As WorkbookEvents_WindowResizeEventHandler
'Usage
Dim instance As Workbook 
Dim handler As WorkbookEvents_WindowResizeEventHandler 

AddHandler instance.WindowResize, handler
public event WorkbookEvents_WindowResizeEventHandler WindowResize
public:
 event WorkbookEvents_WindowResizeEventHandler^ WindowResize {
    void add (WorkbookEvents_WindowResizeEventHandler^ value);
    void remove (WorkbookEvents_WindowResizeEventHandler^ value);
}
JScript does not support events.

Examples

The following code example demonstrates a handler for the WindowResize event. The event handler displays the name that appears in the title bar of the workbook window that was resized.

This example is for a document-level customization.

Private Sub ThisWorkbook_WindowResize(ByVal Wn As Excel.Window) _
    Handles Me.WindowResize
    MsgBox(Wn.Caption & " resized.")
End Sub
private void WorkbookWindowResize()
{
    this.WindowResize +=
        new Excel.WorkbookEvents_WindowResizeEventHandler(
        ThisWorkbook_WindowResize);
}

private void ThisWorkbook_WindowResize(Excel.Window Wn)
{
    MessageBox.Show(Wn.Caption + " resized.");
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace