共用方式為


WorkbookBase.WindowResize Event

Definition

Occurs when any workbook window is resized.

public:
 event Microsoft::Office::Interop::Excel::WorkbookEvents_WindowResizeEventHandler ^ WindowResize;
public event Microsoft.Office.Interop.Excel.WorkbookEvents_WindowResizeEventHandler WindowResize;
member this.WindowResize : Microsoft.Office.Interop.Excel.WorkbookEvents_WindowResizeEventHandler 
Public Custom Event WindowResize As WorkbookEvents_WindowResizeEventHandler 

Event Type

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 void WorkbookWindowResize()
{
    this.WindowResize +=
        new Excel.WorkbookEvents_WindowResizeEventHandler(
        ThisWorkbook_WindowResize);
}

private void ThisWorkbook_WindowResize(Excel.Window Wn)
{
    MessageBox.Show(Wn.Caption + " resized.");
}
Private Sub ThisWorkbook_WindowResize(ByVal Wn As Excel.Window) _
    Handles Me.WindowResize
    MsgBox(Wn.Caption & " resized.")
End Sub

Applies to