Namespace:
System.Windows.Controls
Assembly:
System.Windows (in System.Windows.dll)
Visual Basic (Declaration)
Public Function ShowDialog As Nullable(Of Boolean)
Dim instance As OpenFileDialog
Dim returnValue As Nullable(Of Boolean)
returnValue = instance.ShowDialog()
public Nullable<bool> ShowDialog()
Return Value
Type:
System..::.Nullable<(Of <(Boolean>)>)
true if the user clicked OK; false if the user clicked Cancel or closed the dialog box.
| Exception | Condition |
|---|
| InvalidOperationException |
Silverlight was unable to display the dialog box. |
| SecurityException | Active Scripting in Internet Explorer is disabled. -or- The call to the ShowDialog method was not made from user-initiated code. |
Use the return value of the ShowDialog method to determine whether the user selected a file.
The ShowDialog method can only be called from user-initiated code, such as a button Click event. If ShowDialog is called from code that is not user-initiated, such as a Page Loaded event, a SecurityException is thrown.
The Silverlight plug-in does not support OpenFileDialog in full-screen mode. In most cases, displaying this dialog box in full-screen mode will cause the plug-in to revert to embedded mode. To avoid issues on some browsers, you should exit full-screen mode before using this class. For more information, see Full-Screen Support.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Reference
Other Resources