private void X_textBox_TextChanged(object sender, EventArgs e) { if (int.TryParse(X_textBox.Text, out x)) { if ((x >= 0) && (x <= pictureBox1.Width)) { g.Clear(System.Drawing.Color.White); g.DrawLine(p, x, y, l * MathF.Cos(angal) + x, l * MathF.Sin(angal) + y); } else { Step_timer.Stop(); MessageBox.Show("Значения должны быть в диапазоне от 0 до " + pictureBox1.Width); Step_timer.Start(); } } }
private void Pause_button_Click(object sender, EventArgs e) { Step_timer.Stop(); Start_button.Enabled = true; Pause_button.Enabled = false; }