private void AddFlightData(FlightData flightData) { if (flightData.IsHandleCreated) { flightData.Invoke(new Action(() => flightData.Location = new Point(isFirstX ? startBoardX : newBoardX, startBoardY))); } else { flightData.Location = new Point(isFirstX ? startBoardX : newBoardX, startBoardY); } startBoardY = isFirstX ? startBoardY : startBoardY + flightData.Height + 10; newBoardX = startBoardX + flightData.Width + 30; isFirstX = !isFirstX; if (userBoard.IsHandleCreated) { userBoard.Invoke(new Action(() => userBoard.GetPanel.Controls.Add(flightData))); } else { userBoard.GetPanel.Controls.Add(flightData); } }