DocumentBase.WindowSize Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the document window is resized or moved.
public:
event Microsoft::Office::Tools::Word::WindowEventHandler ^ WindowSize;
public event Microsoft.Office.Tools.Word.WindowEventHandler WindowSize;
member this.WindowSize : Microsoft.Office.Tools.Word.WindowEventHandler
Public Custom Event WindowSize As WindowEventHandler
Event Type
Examples
The following code example creates a handler for the WindowSize event. The event handler displays in the window caption the number of times that the window has been resized. To use this example, run it from the ThisDocument
class in a document-level project.
int resizeCount = 0;
private void DocumentWindowSize()
{
this.WindowSize +=
new Microsoft.Office.Tools.Word.WindowEventHandler(
ThisDocument_WindowSize);
}
void ThisDocument_WindowSize(object sender,
Microsoft.Office.Tools.Word.WindowEventArgs e)
{
resizeCount++;
e.Window.Caption = "Window resized " +
resizeCount.ToString() + " times.";
}
Private resizeCount As Integer = 0
Private Sub DocumentWindowSize()
AddHandler Me.WindowSize, AddressOf ThisDocument_WindowSize
End Sub
Private Sub ThisDocument_WindowSize(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.WindowEventArgs)
resizeCount += 1
e.Window.Caption = "Window resized " & resizeCount.ToString() & " times."
End Sub