Adding GLcontrol for visual studio toolkit
Maybe the question is simple, but I am using OpenTK with WinForms, the problem is I cannot find GLcontrol in the toolbar, so I added it manually in Form1.Designer.cs, this is the #region code Created by Windows Forms designer
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
glcontrol1 = new OpenTK.GLControl();
this.SuspendLayout();
//
// glControl1
//
//
// Form1
//
this.Controls.Add(glcontrol1);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(584, 561);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
OpenTK.GLControl glcontrol1;
the problem is when I open Form1 in development mode, it shows these messages "could not load OpenTK type.ToolkitOptions from assembly ..." "variable glcontrol1 is either not declared or not specified" I would like to add GLcontrol to toolbar, does anyone know how?
source to share
Double check the links on the project, you need both OpenTK.dll
, and OpenTK.GLControl.dll
.
Adding GLControl to the WinForms toolbar is described in "Creating a Windows.Forms + GLControl Application" in the documentation.
First, create a shape that you will place your GLControl on. Right-click in some empty space on the toolbar, select "Select Items ..." and select
OpenTK.GLControl.dll
. Make sure you can find "GLControl" listed under ".NET Framework Components" as shown in the image below.
Then you can add GLControl to your form like any .NET control. A GLControl named glControl1 will be added to your form.
source to share