DiagramControl.OpenFile Method

Syntax

C#

public void OpenFile()

VB

Public Sub OpenFile()

Remarks

The Diagram Control's Ribbon menu contains the "Open" button that redirects the action to the OpenFile method. By default, the standard "Open File" dialog is shown by this method.
The full name of the file selected in the "Open File" dialog is automatically assigned to the DocumentSource property.

The ShowingOpenDialog event allows you to replace the standard "Open File" dialog with a custom one or perform your own actions when the "Open" button (in the Ribbon menu) is clicked or when the OpenFile method is directly called.

You may encounter exceptions when loading/saving a diagram (e.g., when trying to load a diagram from a file that does not exist, or saving to a read-only file). To handle or suppress these exceptions, use the ExceptionMessage event.