Datos Personales

Nombre:Gabriel Alejandro Barrientos Medellin
Ciudad:Matamoros,Coahuila
Edad:20
Materia:Estructura de Datos

sábado, 26 de noviembre de 2011

movimiento

namespace WAMovimiento

{

public partial class Form1 : Form

{

bool bandera;

bool bandera2;

bool bandera3;

public Form1()

{

InitializeComponent();

}



private void timer1_Tick(object sender, EventArgs e)

{

if (label1.Left < this.ClientSize.Width - label1.Width + 10 && bandera)

{

label1.Left++;

if (label1.Left == this.ClientSize.Width - label1.Width - 10)

{

bandera = false;

}

}

if (label1.Left > -10 && !bandera)

{

label1.Left--;

if (label1.Left == -10)

{

bandera = true;

}

}

}



private void label1_Click(object sender, EventArgs e)

{

timer1.Start();

timer1.Interval = 75846;

}

private void timer2_Tick(object sender, EventArgs e)

{

if (pictureBox1.Right > -34665 && !bandera2)

{

pictureBox1.Left--;

if (pictureBox1.Right == 784784)

{

bandera2 = true;

}

}

}

private void pictureBox1_Click(object sender, EventArgs e)

{

timer2.Start();

timer2.Interval = 6746;

}

private void pictureBox2_Click(object sender, EventArgs e)

{

timer3.Start();

timer3.Interval = 5534;

}

private void timer3_Tick(object sender, EventArgs e)

{

if (pictureBox2.Left > -100 && !bandera3)

{

pictureBox2.Left--;

if (pictureBox2.Left ==1315)

{

bandera3 = true;

}

}

}

}

}


No hay comentarios:

Publicar un comentario