ana sayfa > C#.NET, Görsel Programlama > Yakala Yakalaya Bilirsen C#.NET(C.NET)

Yakala Yakalaya Bilirsen C#.NET(C.NET)

Çarşamba, 20 Oca 2010 yorum ekle yorumlara git




Yakala Yakalaya Bilirsen C#.NET(C.NET)….yakala




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";
        }
    }


Projeyi İNDİR





  1. şimdilik yorum yok.
  1. şimdilik geri bağlantı yok