Müdavim Girişi

E-Posta
Parola

Ücretsiz Kayıt Ol


Online Müdavimler (0 Kişi)
  • Online Kişi Bulunmadı

Yazar Hakkında
x
İsmail Kocacan
İsmail Kocacan is experienced on many development platforms and continues to learn technologies. Since the age of 16-17, dealing with software technologies. And continuous learning, teaching, research, continues to develop.
C# ListBox Nesnesi Kullanımı

Merhaba arkadaslar;

Bu örnek uygulamada sizlere ListBox Nesnesindeki degerleri birbirine aktarmayi göstericem.Burada aslinda anlatilcak pek fazla bisey yok.Göstermek istedigim kullanim yöntemidir.

using System;
using System.Windows.Forms;
 
namespace ListboxAktar
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void button1_Click(object sender, EventArgs e)
       {
            object[] seciliParcalar = new object[listBox1.SelectedItems.Count];
            for (int i = 0; i < listBox1.SelectedItems.Count; i++)
                seciliParcalar[i] = listBox1.SelectedItems[i];
            listBox2.Items.AddRange(seciliParcalar);
            if (checkBox1.Checked) this.ListedenSecilileriSil(listBox1);
        }
 
 
 
        private void ListedenSecilileriSil(ListBox ListeBoxNesnesi)
        {
            for (int j = 0; j < ListeBoxNesnesi.Items.Count; j++)
            {
                if (ListeBoxNesnesi.SelectedIndex == j)
                {
                    ListeBoxNesnesi.Items.RemoveAt(j);
                    j = -1;
                }
            }
        }
 
 
        private void button2_Click(object sender, EventArgs e)
        {
            object[] seciliParcalar = new object[listBox2.SelectedItems.Count];
            for (int i = 0; i < listBox2.SelectedItems.Count; i++)
                seciliParcalar[i] = listBox2.SelectedItems[i];
            listBox1.Items.AddRange(seciliParcalar);
            if (checkBox1.Checked) this.ListedenSecilileriSil(listBox2);
        }
 
    }
}
 

 Sonuç;

 Uygulamaya ait dosyalari buradan indirebilirsiniz
 Herkese iyi Kodlamalar
ismail Kocacan


Kategori : Yazılım Tasarımı | 31.10.2010 13:40:00  | 5837 defa okundu  | 0 Yorum |

Yazara Ait Diğer Makaleler(51) Makaleye Yapılan Yorumlar İlk yorum yazan siz olun
Ara
 
Anket
Hangi VeriTabanı Yönetim Sistemini Kullanıyorsunuz ?