Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
Silverlight 3
ChildWindow Class
ChildWindow Methods
 Show Method
Collapse All/Expand All Collapse All
.NET Framework Class Library for Silverlight
ChildWindow..::.Show Method

Opens a ChildWindow and returns without waiting for the ChildWindow to close.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls (in System.Windows.Controls.dll)
Visual Basic (Declaration)
Public Sub Show
Visual Basic (Usage)
Dim instance As ChildWindow

instance.Show()
C#
public void Show()
ExceptionCondition
InvalidOperationException

The child window is already in the visual tree.

When the ChildWindow class is instantiated, it is not visible by default. The Show method displays the child window and returns immediately, without waiting for the child window to close. This lets activity on the parent window, such as an animation, continue while the child window is open. However, the parent window is disabled as long as the child window is open, so that user interaction with the parent window is not possible.

When the child window is opened, if there are elements that have their IsTabStop property set to true, the element with the lowest TabIndex will get focus. However, if there are no elements that have their IsTabStop property set to true, no focus is set.

To detect when a child window is shown, you can override the OnOpened method.

The following code demonstrates how to instantiate a ChildWindow, set its content, and then show it. This example is part of a larger example available in the ChildWindow class overview.

Visual Basic
Dim cw As New ChildWindow
cw.Content = "Please enter name and password or click Cancel."
cw.Show()
C#
ChildWindow cw = new ChildWindow();
cw.Content = "Please enter name and password or click Cancel.";
cw.Show();

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker