WinForms - Add ShowDevTools menu item

This commit is contained in:
amaitland 2018-02-06 10:35:31 +10:00
parent 9f7b6ab74d
commit ca7ddc1a18
2 changed files with 17 additions and 2 deletions

View File

@ -39,7 +39,8 @@
this.goButton = new System.Windows.Forms.ToolStripButton();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.showDevToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripContainer.ContentPanel.SuspendLayout();
this.toolStripContainer.TopToolStripPanel.SuspendLayout();
this.toolStripContainer.SuspendLayout();
@ -152,11 +153,19 @@
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.showDevToolsToolStripMenuItem,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "File";
//
//
// showDevToolsToolStripMenuItem
//
this.showDevToolsToolStripMenuItem.Name = "showDevToolsToolStripMenuItem";
this.showDevToolsToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
this.showDevToolsToolStripMenuItem.Text = "Show DevTools";
this.showDevToolsToolStripMenuItem.Click += new System.EventHandler(this.ShowDevToolsMenuItemClick);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
@ -203,6 +212,7 @@
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.Label outputLabel;
private System.Windows.Forms.Label statusLabel;
private System.Windows.Forms.ToolStripMenuItem showDevToolsToolStripMenuItem;
}
}

View File

@ -158,5 +158,10 @@ namespace CefSharp.MinimalExample.WinForms
browser.Load(url);
}
}
private void ShowDevToolsMenuItemClick(object sender, EventArgs e)
{
browser.ShowDevTools();
}
}
}