Created
October 13, 2014 13:16
-
-
Save jankurianski/0c2a576561816a602edb to your computer and use it in GitHub Desktop.
Move dock and visibility settings to designer so CEF gets right size on startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From c4493f98dd1742bda6818cda48dd52d9dd7d419c Mon Sep 17 00:00:00 2001 | |
From: jankurianski <[email protected]> | |
Date: Mon, 13 Oct 2014 23:55:09 +1100 | |
Subject: [PATCH] Browser now docks properly on startup | |
--- | |
.../BrowserTabUserControl.Designer.cs | 3 ++- | |
CefSharp.WinForms.Example/BrowserTabUserControl.cs | 18 ------------------ | |
2 files changed, 2 insertions(+), 19 deletions(-) | |
diff --git a/CefSharp.WinForms.Example/BrowserTabUserControl.Designer.cs b/CefSharp.WinForms.Example/BrowserTabUserControl.Designer.cs | |
index 6bc49f5..d6f786e 100644 | |
--- a/CefSharp.WinForms.Example/BrowserTabUserControl.Designer.cs | |
+++ b/CefSharp.WinForms.Example/BrowserTabUserControl.Designer.cs | |
@@ -58,6 +58,7 @@ private void InitializeComponent() | |
this.toolStrip2.Name = "toolStrip2"; | |
this.toolStrip2.Size = new System.Drawing.Size(730, 25); | |
this.toolStrip2.TabIndex = 0; | |
+ this.toolStrip2.Visible = false; | |
// | |
// findTextBox | |
// | |
@@ -168,7 +169,7 @@ private void InitializeComponent() | |
// | |
// browserPanel | |
// | |
- this.browserPanel.Dock = System.Windows.Forms.DockStyle.None; | |
+ this.browserPanel.Dock = System.Windows.Forms.DockStyle.Fill; | |
this.browserPanel.Location = new System.Drawing.Point(0, 25); | |
this.browserPanel.Name = "browserPanel"; | |
this.browserPanel.Size = new System.Drawing.Size(730, 414); | |
diff --git a/CefSharp.WinForms.Example/BrowserTabUserControl.cs b/CefSharp.WinForms.Example/BrowserTabUserControl.cs | |
index 85c76ec..f8c61bb 100644 | |
--- a/CefSharp.WinForms.Example/BrowserTabUserControl.cs | |
+++ b/CefSharp.WinForms.Example/BrowserTabUserControl.cs | |
@@ -32,29 +32,11 @@ public BrowserTabUserControl(string url) | |
var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion); | |
DisplayOutput(version); | |
- Load += BrowserTabUserControlLoad; | |
- | |
Disposed += BrowserTabUserControlDisposed; | |
- | |
- browserPanel.Paint += BrowserPanelPaint; | |
- } | |
- | |
- private void BrowserPanelPaint(object sender, PaintEventArgs e) | |
- { | |
- //NOTE: Hack to get child control to dock properly | |
- browserPanel.Dock = DockStyle.Fill; | |
- | |
- browserPanel.Paint -= BrowserPanelPaint; | |
- } | |
- | |
- private void BrowserTabUserControlLoad(object sender, EventArgs e) | |
- { | |
- ToggleBottomToolStrip(); | |
} | |
private void BrowserTabUserControlDisposed(object sender, EventArgs e) | |
{ | |
- Load -= BrowserTabUserControlLoad; | |
Disposed -= BrowserTabUserControlDisposed; | |
Browser.NavStateChanged -= OnBrowserNavStateChanged; | |
-- | |
1.9.4.msysgit.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment