【发布时间】:2014-11-19 16:23:03
【问题描述】:
也许问题很简单,但我使用的是带有 WinForms 的 OpenTK,问题是我在工具箱中找不到 GLcontrol,所以我在 Form1.Designer.cs 中手动添加了它,这是代码 #region Windows 窗体设计器生成的代码
/// <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;
问题是当我在设计模式下打开 Form1 时,它会显示这些消息 “无法从程序集中加载类型 OpenTK.ToolkitOptions ...” “变量 glcontrol1 未声明或未分配” 我想要一种将 GLcontrol 添加到工具箱的方法,有人知道怎么做吗?
【问题讨论】:
-
这是调用堆栈以备不时之需:OpenTK.GLControl..ctor(GraphicsMode mode, Int32 major, Int32 minor, GraphicsContextFlags flags) at OpenTK.GLControl..ctor()