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 Form1_Load( sender, EventArgs e)
{
}
private void Form1_MouseClick( sender, MouseEventArgs e)
{
this.Text = this.Width.ToString() + "***********" + this.Height.ToString();
Random r = new Random();
int x = r.Next(1, 500);
int y = r.Next(1, 700);
button1.Left = x;
button1.Top = y;
button1.Visible = true;
button1.Text = button1.Top.ToString() + "\n" + button1.Left.ToString();
}
private void button1_Click( sender, EventArgs e)
{
button1.Top = Convert.ToInt32(textBox1.Text);
}
private void button2_Click( sender, EventArgs e)
{
button2.Text = button2.Top.ToString()+"\n"+button2.Left.ToString();
}
}
}