private void Form1_Load(object sender, EventArgs e) { w1 = new Window(new Vec2(30, 30), new Vec2(120, 80), "Test Window 1"); w1.ClearColor = Colors.Green; Button bt = new Button(new Vec2(10, 10), new Vec2(30, 10)); bt.Click += new MouseEvent(bt_Click); bt.Parent = w1; w1.Controls.Add(bt); Window w2 = new Window(new Vec2(80, 30), new Vec2(120, 80), "Test Window 2"); w2.ClearColor = Colors.Red; Window w3 = new Window(new Vec2(130, 30), new Vec2(120, 80), "Test Window 3"); w3.ClearColor = Colors.Blue; windowManager.AddWindow(w1); windowManager.AddWindow(w2); windowManager.AddWindow(w3); windowManager.BringWindowToFront(w1); InitializeMouse(); Forms.Cursor.Hide(); i.Clear(Colors.White); //i.DrawString(new Vec2(30, 30), "T", fnt, 20, Orvid.Graphics.FontSupport.FontStyle.Normal, Colors.Black); // Draw exit button. ExitButton b = new ExitButton(new Vec2(DesktopWidth - 21, 1), new Vec2(20, 20), i, this); Objects.Add(b.evnts); DrawCursor(); pictureBox1.Image = (System.Drawing.Bitmap)i; pictureBox1.Refresh(); // Now we need to restore what was behind the mouse. Vec2 v = new Vec2((int)MouseX, (int)MouseY); i.DrawImage(v, behindMouseImage); }