private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex == 0) { this.BackColor = Color.Black; label1.ForeColor = Color.Silver; label1.Text = "Environment is Space"; pictureBox2.Image = list.Images[4]; t = 100; // iteration amount } else if (comboBox1.SelectedIndex == 1) { this.BackColor = Color.PaleTurquoise; label1.Text = "Environment is Water"; pictureBox2.Image = list.Images[3]; t = 50; // iteration amount } else if (comboBox1.SelectedIndex == 2) { this.BackColor = Color.DarkGoldenrod; label1.ForeColor = Color.Firebrick; label1.Text = "Environment is Honey"; pictureBox2.Image = list.Images[2]; t = 20; // iteration amount } } private void Form1_Paint(object sender, PaintEventArgs e) { // Drawing arrow Pen pen = new Pen(Color.FromArgb(255, 0, 0, 255), 8); pen.StartCap = LineCap.ArrowAnchor; pen.EndCap = LineCap.RoundAnchor; e.Graphics.DrawLine(pen, x+50, 200, x, 200); } private void Form1_KeyPress(object sender, KeyPressEventArgs e) { // pressed Enter => change x if (e.KeyChar == (char)Keys.Return) { e.Handled = true; if (x < y) { x += t; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)