private void onTick(int s1) { countedDays = s1; SpaceObject sun = (SpaceObject)(a[0]); sun.calculateXY(countedDays, 0, 0); if (countedDays < days) { this.countedDays = s1; } else { Debug.Print("Removing labels in tick"); timerEvent.stop(); moving = false; removeLabels(); } if (removeLabel) { removeLabels(); } this.Invalidate(); }