using System.Windows.Forms; using Drawing3d; namespace Sample { public partial class Form1 : Form { MyDevice Device = new MyDevice(); public Form1() { InitializeComponent(); Device.WinControl = this; } } public class MyDevice:OpenGlDevice { public override void OnPaint() { base.OnPaint(); drawSphere(3); } } }