C#-将GLcontrol添加到Visual Studio工具箱
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了C#-将GLcontrol添加到Visual Studio工具箱,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1568字,纯文字阅读大概需要3分钟。
内容图文
![C#-将GLcontrol添加到Visual Studio工具箱](/upload/InfoBanner/zyjiaocheng/661/3a237cfcd7e14f9881b162efb6d2133b.jpg)
也许问题很简单,但是我在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.dll和OpenTK.GLControl.dll.
文档中的“Building a Windows.Forms + GLControl based application”涵盖了将GLControl添加到WinForms工具箱中.
To begin with, create a Form on which you will place your GLControl. Right click in some empty space of the Toolbox, pick “Choose Items…” and browse for
OpenTK.GLControl.dll
. Make sure you can find the “GLControl” listed in the “.NET Framework Components”, as in the image below.
Then you can add the GLControl to your form as any .NET control. A GLControl named glControl1 will be added to your Form.
内容总结
以上是互联网集市为您收集整理的C#-将GLcontrol添加到Visual Studio工具箱全部内容,希望文章能够帮你解决C#-将GLcontrol添加到Visual Studio工具箱所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。