Edit

Share via


How to: Open a Window

This example shows how to open a window.

Example

A window is opened by instantiating Window and calling the Show method. Show opens a window and returns immediately without waiting for the new window to close. This type of window is also known as a modeless window, and doesn't restrict user input.

CustomWindow window = new CustomWindow();
window.Show(); // Returns immediately
Dim window As New CustomWindow()
window.Show() ' Returns immediately

.NET Framework Security

Instantiating Window requires permission to call unsafe native methods (see Window).