12.07.2015 Views

bu döküman kaan aslan tarafından c ve sistem ... - Kitabxana

bu döküman kaan aslan tarafından c ve sistem ... - Kitabxana

bu döküman kaan aslan tarafından c ve sistem ... - Kitabxana

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

namespace CSD{class App{public static void Main(){Application.Run(new MyForm());}class MyForm : Form{public MyForm(){this.Text = "Sample E<strong>ve</strong>nt";this.Click += new E<strong>ve</strong>ntHandler(clickE<strong>ve</strong>ntHandler);}}}}private void clickE<strong>ve</strong>ntHandler(object sender, E<strong>ve</strong>ntArgs e){MessageBox.Show("Click");}MouseDown <strong>ve</strong> MouseUp Mesajları: Fareyle tuşa basıldığında MouseDown mesajı el tuştançekildiğinde MouseUp mesajı oluşur. Çağrılan sanal fonksiyonlar Control sınıfının OnMouseDown<strong>ve</strong> OnMouseUp fonksiyonlarıdır. İlgili E<strong>ve</strong>nt elemanı MouseDown <strong>ve</strong> MouseUp isimlielemanlardır.Bu mesajlar da çalışma alanı mesajlarıdır. Nu mesajlar oluştuğunda hangi tuşa basılmış ya daçekilmiş olduğu <strong>ve</strong> hangi koordinatta <strong>bu</strong> işin gerçekleştiği bilgileri de <strong>ve</strong>rilmektedir. Bu mesajlarınmesaj parametre sınıfı MouseE<strong>ve</strong>ntArgs isimli sınıftır. Bu sınıfın X <strong>ve</strong> Y isimli int türden ReadOnly property elemanları basım <strong>ve</strong> çekim koordinatlarını <strong>ve</strong>rmektedir. Sınıfın Location isimliproperty elemanı ise aynı koordinatı point olarak <strong>ve</strong>rir. Hangi tuşa basıldığı Button property(publicMouseButtons Button { get; }) si ile elde edilebilir. Bu property MouseButtom isimli bir enumtüründendir. Sınıfın diğer elemanları MSDN dökumanlarından izlenmelidir. MouseDown <strong>ve</strong>MouseUp e<strong>ve</strong>nt elemanları MouseDownHandler delege türündendir.using System;using System.Windows.Forms;using System.Drawing;namespace CSD{class App{public static void Main(){Application.Run(new MyForm());}33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!