Editor for WinForms | ComponentOne
C1.Win.C1Editor.4.8 Assembly / C1.Win.C1Editor Namespace / C1Editor Class / ShowDialog Method
The type of dialog box to show.
Example

In This Topic
    ShowDialog Method (C1Editor)
    In This Topic
    Shows the specified dialog box.
    Syntax
    'Declaration
     
    Public Sub ShowDialog( _
       ByVal type As DialogType _
    ) 
    public void ShowDialog( 
       DialogType type
    )

    Parameters

    type
    The type of dialog box to show.
    Example
    This example shows how to add an "Add Image" button to the form.
    private void Form1_Load(object sender, EventArgs e)
    {
       _btnAddImage = new Button();
       _btnAddImage.Text = "Add Image";
       _btnAddImage.Click += AddPictureDialog;
       this.Controls.Add(_btnAddImage);
                
       _btnAddImage.Location = new Point(10, 10);
                
       c1Editor1.DocumentChanged += UpdateUI;
       c1Editor1.SelectionChanged += UpdateUI;
       c1Editor1.ModeChanged += UpdateUI;
    }
                
    private void AddPictureDialog(object sender, EventArgs e)
    {
       c1Editor1.ShowDialog(DialogType.Image);
    }
                
    private void UpdateUI(object sender, EventArgs e)
    {
       _btnAddImage.Enabled = c1Editor1.CanShowDialog(DialogType.Image);
    }
    See Also