Files
docs-desktop/dotnet-desktop-guide/framework/wpf/app-development/how-to-open-a-window.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.2 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Open a Window 03/30/2017
csharp
vb
windows [WPF], opening
opening windows [WPF]
6b91b2bb-fda7-491d-a72e-139dd630a5b0

How to: Open a Window

This example shows how to open a window.

Example

A window is opened by instantiating xref:System.Windows.Window and calling the xref:System.Windows.Window.Show%2A method. xref:System.Windows.Window.Show%2A 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.

[!code-csharpHOWTOWindowManagementSnippets#OpenNewWindowCODE] [!code-vbHOWTOWindowManagementSnippets#OpenNewWindowCODE]

.NET Framework Security

Instantiating xref:System.Windows.Window requires permission to call unsafe native methods (see xref:System.Windows.Window.%23ctor%2A).