[]
        
(Showing Draft Content)

C1.Win.C1Editor.C1Editor.CanShowDialog

CanShowDialog Method

CanShowDialog(DialogType)

Returns a Boolean value indicating whether or not the specified dialog can be shown.

Declaration
public bool CanShowDialog(DialogType type)
Public Function CanShowDialog(type As DialogType) As Boolean
Parameters
Type Name Description
DialogType type

The dialog type.

Returns
Type Description
bool

A Boolean value indicating whether or not the specified dialog can be shown.

Examples

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);
        }</code></pre>