Yakala Yakalaya Bilirsen C#

Yakala Yakalaya Bilirsen C#yakala

[code language=”CSharp”]
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
label2.Text = “Bravo Beni Yakaladınız.”;

}

private void button1_MouseMove(object sender, MouseEventArgs e)
{
Random koordinat = new Random(); //yeni koordinatları rastgele sayıya atıyoruz
if (string.Compare(textBox1.Text,”hoca”)!= 0)
{
button1.Left= Convert.ToInt32(koordinat.Next(this.Size.Width- button1.Size.Width));
//burda butonun leftini ayarlıyoruz ve formun boyutu kadar ayarlıyoruz kendinide çıkardıkki en köşeye gitmesin
button1.Top = Convert.ToInt32(koordinat.Next(this.Size.Height – (label1.Height + label2.Height + button1.Height)) + label1.Height);
}
}

private void Form1_Load(object sender, EventArgs e)
{
label2.Text = textBox1.Text + ” Sıkıysa Yakala”;
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
label2.Text = textBox1.Text + ” Sıkıysa Yakala”;
}
}
[/code]

 

Projeyi İNDİR

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir