Exemplo n.º 1
0
 /// <summary>
 /// The method that determines all wanted values and that is called in every tick.
 /// </summary>
 private void updatePosition(PositionData positionData)
 {
     // Update position.
     Position = positionData;
     // Update coordinates in title.
     this.Text = String.Format("MPos | X: {0} Y: {1}", Position.PhysicalPosition.X, Position.PhysicalPosition.Y);
     // Attempt to redraw panel.
     panDraw.Invalidate();
 }
Exemplo n.º 2
0
 public MainForm()
 {
     Settings = new Settings();
     Position = new PositionData();
     initManager();
     updateChecker = new WinFormsUpdateChecker(Program.UpdateCheckUrl, this);
     InitializeComponent();
     initControls();
     this.KeyPreview  = true;
     this.KeyDown    += MainForm_KeyDown;
     this.DpiChanged += MainForm_DpiChanged;
     // Create and start the timer.
     timer = new Timer()
     {
         Interval = 50
     };
     timer.Tick += Timer_Tick;
     panDraw.Focus();
 }