using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication34
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Random rastegelesayı = new Random();
private void timer1_Tick(object sender, EventArgs e)
{
timer1.Start();
if (radioButton5.Checked == true)
{
pictureBox1.Top -= 5;
panel9.BackColor = Color.Silver;
panel10.BackColor = Color.Silver;
if (pictureBox1.Top <= label14.Top)
{
timer1.Stop();
panel1.BackColor = Color.Yellow;
panel2.BackColor = Color.Yellow;
}
}
if (radioButton6.Checked == true)
{
timer1.Start();
pictureBox1.Top -= 5;
panel1.BackColor = Color.Silver;
panel2.BackColor = Color.Silver;
panel9.BackColor = Color.Silver;
panel10.BackColor = Color.Silver;
panel3.BackColor = Color.Silver;
panel4.BackColor = Color.Silver;
panel5.BackColor = Color.Silver;
panel6.BackColor = Color.Silver;
if (pictureBox1.Top <= label18.Top)
{
panel8.BackColor = Color.Yellow;
panel7.BackColor = Color.Yellow;
timer1.Stop();
}
}
if (radioButton3.Checked == true)
{
panel1.BackColor = Color.Silver;
panel2.BackColor = Color.Silver;
panel9.BackColor = Color.Silver;
panel10.BackColor = Color.Silver;
timer1.Start();
pictureBox1.Top -= 5;
if (pictureBox1.Top <= label15.Top)
{
timer1.Stop();
panel3.BackColor = Color.Yellow;
panel4.BackColor = Color.Yellow;
}
}
if (radioButton4.Checked == true)
{
panel1.BackColor = Color.Silver;
panel2.BackColor = Color.Silver;
panel3.BackColor = Color.Silver;
panel4.BackColor = Color.Silver;
panel9.BackColor = Color.Silver;
panel10.BackColor = Color.Silver;
timer1.Start();
pictureBox1.Top -= 5;
if (pictureBox1.Top <= label1.Top)
{
timer1.Stop();
panel5.BackColor = Color.Yellow;
panel6.BackColor = Color.Yellow;
}
if (radioButton2.Checked == true)
{
pictureBox1.Top += rastegelesayı.Next(5, 16);
}
if (pictureBox1.Top <= label19.Top)
{
timer1.Stop();
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Start();
radioButton3.Checked = false;
panel10.BackColor = Color.Yellow;
panel9.BackColor = Color.Yellow;
}
private void radioButton5_CheckedChanged(object sender, EventArgs e)
{
timer1.Start();
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
timer1.Start();
}
private void radioButton4_CheckedChanged(object sender, EventArgs e)
{
timer1.Start();
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
timer1.Start();
}
private void radioButton6_CheckedChanged(object sender, EventArgs e)
{
timer1.Start();
}
}
}
Hiç yorum yok:
Yorum Gönder