From 9725f72fb99efe2bf27cf70ee281f72ad54f5b76 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 11 Nov 2007 19:39:09 +0000 Subject: [PATCH] glControl1_Resize event was not fired. --- Source/Examples/WinForms/W01_First_Window.Designer.cs | 1 + Source/Examples/WinForms/W01_First_Window.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Examples/WinForms/W01_First_Window.Designer.cs b/Source/Examples/WinForms/W01_First_Window.Designer.cs index f8fc8583..195e864b 100644 --- a/Source/Examples/WinForms/W01_First_Window.Designer.cs +++ b/Source/Examples/WinForms/W01_First_Window.Designer.cs @@ -78,6 +78,7 @@ this.glControl1.Size = new System.Drawing.Size(629, 565); this.glControl1.TabIndex = 0; this.glControl1.VSync = false; + this.glControl1.Resize += new System.EventHandler(this.glControl1_Resize); this.glControl1.Paint += new System.Windows.Forms.PaintEventHandler(this.glControl1_Paint); this.glControl1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.glControl1_KeyDown); // diff --git a/Source/Examples/WinForms/W01_First_Window.cs b/Source/Examples/WinForms/W01_First_Window.cs index c0f59f43..eb17fa53 100644 --- a/Source/Examples/WinForms/W01_First_Window.cs +++ b/Source/Examples/WinForms/W01_First_Window.cs @@ -45,6 +45,7 @@ namespace Examples.WinForms { base.OnLoad(e); + glControl1_Resize(this, EventArgs.Empty); // Ensure the Viewport is set up correctly GL.ClearColor(Color.Crimson); } @@ -72,7 +73,7 @@ namespace Examples.WinForms glControl1.SwapBuffers(); } - private void glControl1_Resize(object sender, OpenTK.Platform.ResizeEventArgs e) + private void glControl1_Resize(object sender, EventArgs e) { if (glControl1.ClientSize.Height == 0) glControl1.ClientSize = new System.Drawing.Size(glControl1.ClientSize.Width, 1);