using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;namespace
WindowsApplication1{
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
}
private void button1_Click( sender, EventArgs e){
bmove(button2 );
}
private void bmove(Button b){
b.Text =
"C#";b.BackColor =
Color.Coral;b.Left = 100;
b.Top = 200;
b.Width = 200;
b.Height = 100;
}
private void button2_Click( sender, EventArgs e){
bmove(listBox1);
}
private void bmove(ListBox b){
b.Text =
"C#";b.BackColor =
Color.Coral;b.Left = 500;
b.Top = 200;
b.Width = 200;
b.Height = 100;
}
private void move1(Button c){
c.Left += 3;
}
private void timer1_Tick( sender, EventArgs e){
move1(button1);
}
private void button3_Click( sender, EventArgs e){
timer1.Start();
}
private void button4_Click( sender, EventArgs e){
timer1.Stop();
}
private void Form1_Load( sender, EventArgs e){
}
}
}