private void btnStart2_Click(object sender, EventArgs e) { GenerateGraph(); List <int> path = m_graph.AStarMethod(m_startPosX + 64 * m_startPosY, m_endPosX + 64 * m_endPosY); PaintPath(path); mapPanel.Refresh(); // Horizontal.Start(); // Vertical.Start(); jetInventory = int.Parse(lblInventory.Text) * 1000; fuelLevelBar.Maximum = jetFuelLevel * 1000; fuelLevelBar.Step = 1000; fuelBarTimer = new Timer(); fuelBarTimer.Tick += new EventHandler(fuelBarTimer_Tick); fuelBarTimer.Interval = 9000 - jetInventory; fuelBarTimer.Start(); }