![]() |
Listbox hakkında yardım..!! |
Post Reply ![]() |
|
Author | |
defolpislik ![]() Newbie ![]() Joined: 26 Kasım 2012 Location: Turkey Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 03 Kasım 2020 at 13:16 |
Arkladaşlar Merhaba. yeni yeni c# öğrenmek istiyorum ve ufaktan uğraşlar veriyorum. Kullanmış olduğum bir listBox içine, private void btnVeriGir_Click(object sender, EventArgs e) { if (txtVeriGirisi.Text.Trim() != "") { listBox1.Items.Add(txtVeriGirisi.Text.Trim()); txtVeriGirisi.Clear(); } else { MessageBox.Show("Veri Girişi Yapılmadı"); } } private void txtVeriGirisi_Click(object sender, EventArgs e) { txtVeriGirisi.Clear(); } private void btnVeriSil_Click(object sender, EventArgs e) { listBox1.Items.Remove(listBox1.SelectedItem.ToString()); yukarıdaki kodlar ile ekleme silme filan yaptırıyorum ama listbox içinde herhangi birşey seçili değil iken, listBox1.Items.Remove(listBox1.SelectedItem.ToString()); şu koda dönüp null hatası veriyor. yapmak istediğim şey yine bir if yazıp içinde hiş bir sey seçili değil iken mesajbox içinde silinecek veri seçiniz gibi birşey yazdırıp hatadan kurtarmak ama kodu bir türlü bulamadım yardımlarınız için şimdiden teşekkürler.. |
|
![]() |
Post Reply ![]() |
|
Tweet
|
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |