Windows Forms Nedir?
Windows Forms (WinForms), .NET platformunda drag-drop ile masaüstü Windows uygulaması geliştirmeyi sağlayan GUI framework'üdür. 2024'te hâlâ aktif olarak kullanılmaktadır.
Temel Kontroller
- Button, Label, TextBox
- DataGridView — tablo verisi gösterme
- ComboBox, ListBox
- MenuStrip — menü çubuğu
- Timer — zamanlayıcı
Event Sistemi
private void btnKaydet_Click(object sender, EventArgs e) {
string ad = txtAd.Text.Trim();
if (string.IsNullOrEmpty(ad)) {
MessageBox.Show("Ad boş olamaz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
KaydetVeritabani(ad);
MessageBox.Show("Kayıt başarılı!");
}DataGridView ile Listeleme
private void FormYukle() {
using var ctx = new AppDbContext();
dataGridView1.DataSource = ctx.Kullanicilar.ToList();
}Ne Zaman WinForms Kullanılır?
Muhasebe yazılımı, stok takip sistemi, personel yönetimi gibi kurumsal masaüstü uygulamalar için idealdir.