public void Draw() { while (drawing) { r = UpdatePoints(j.GetRawStick()[0], j.GetRawStick()[1]); g.FillEllipse(Brushes.Red, r); try { this.LeftJoyOutput.BeginInvoke((MethodInvoker) delegate() { this.LeftJoyOutput.Text = "(" + String.Format("{0:0.00}", current[0]) + "," + String.Format("{0:0.00}", current[1]) + ")";; }); this.LeftJoystick.BeginInvoke((MethodInvoker) delegate() { this.LeftJoystick.Refresh();; }); } catch (System.InvalidOperationException) { drawing = false; break; } if (RightJoystick.Enabled) { r = UpdatePoints2(j.GetRawStick2()[0], j.GetRawStick2()[1]); g2.FillEllipse(Brushes.Red, r); try { this.RightJoyOutput.BeginInvoke((MethodInvoker) delegate() { this.RightJoyOutput.Text = "(" + String.Format("{0:0.00}", current2[0]) + "," + String.Format("{0:0.00}", current2[1]) + ")";; }); this.RightJoystick.BeginInvoke((MethodInvoker) delegate() { this.RightJoystick.Refresh();; }); } catch (System.InvalidOperationException) { drawing = false; break; } } Thread.Sleep(30); } }