Şimdi Ara

c# form'da seçilenleri sildirme

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
7
Cevap
0
Favori
352
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • "listbox'lardan biriniz seçtiğim zaman geri kalan bütün listboxlar seçilsin" işlemini yapamadım ne yaptıysam hep tek tek seçiliyo
    edit: resim yüklenmedi hızlı resime attım

     c# form'da seçilenleri sildirme



    < Bu mesaj bu kişi tarafından değiştirildi yörük -- 25 Ekim 2014; 20:56:42 >



  • listboxa çift tıkla ondan sonra seçileni indexini al diğer listboxlarında selexted indexlerini birinci listboxınkine eşitle seçilecek harici listboxların enable false yapki ordan seçemesinler sadece yolcu adı kısmından seçim yapabilsinler yardım lazım olursa pm at kolay gelsin
  • public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    ListBoxIndex yeni = new ListBoxIndex(listBox1, listBox2);

    }

    private class ListBoxIndex
    {

    private ListBox[] _listbox;

    public ListBoxIndex(params ListBox[] deger)
    {

    _listbox = deger;

    foreach (ListBox list in deger)
    {

    list.SelectedIndexChanged += new EventHandler(Index_Change);

    }

    }

    private void Index_Change(object sender, EventArgs e)
    {
    int index=((ListBox)sender).SelectedIndex;
    Index_Degistir(index);

    }
    private void Index_Degistir(int index)
    {

    foreach (ListBox a in _listbox)
    {
    if (a.Items.Count > index)
    {
    a.SelectedIndex = index;
    }

    }

    }

    }


    }




  • quote:

    Orijinalden alıntı: Konk_Soft

    listboxa çift tıkla ondan sonra seçileni indexini al diğer listboxlarında selexted indexlerini birinci listboxınkine eşitle seçilecek harici listboxların enable false yapki ordan seçemesinler sadece yolcu adı kısmından seçim yapabilsinler yardım lazım olursa pm at kolay gelsin

    hocam ilginiz için teşekkürler. Şuan yapamıyacam yarın yapamadığım yer olursa size sorarım

    < Bu ileti mobil sürüm kullanılarak atıldı >
  • quote:

    Orijinalden alıntı: emg125

    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    ListBoxIndex yeni = new ListBoxIndex(listBox1, listBox2);

    }

    private class ListBoxIndex
    {

    private ListBox[] _listbox;

    public ListBoxIndex(params ListBox[] deger)
    {

    _listbox = deger;

    foreach (ListBox list in deger)
    {

    list.SelectedIndexChanged += new EventHandler(Index_Change);

    }

    }

    private void Index_Change(object sender, EventArgs e)
    {
    int index=((ListBox)sender).SelectedIndex;
    Index_Degistir(index);

    }
    private void Index_Degistir(int index)
    {

    foreach (ListBox a in _listbox)
    {
    if (a.Items.Count > index)
    {
    a.SelectedIndex = index;
    }

    }

    }

    }


    }

    hocam bunları form1'e mi yazacam yoksa herangi bi toolbox öğesinin içine mi

    < Bu ileti mobil sürüm kullanılarak atıldı >




  • yörük kullanıcısına yanıt
    private class ListBoxIndex
    {

    private ListBox[] _listbox;

    public ListBoxIndex(params ListBox[] deger)
    {

    _listbox = deger;

    foreach (ListBox list in deger)
    {

    list.SelectedIndexChanged += new EventHandler(Index_Change);

    }

    }

    private void Index_Change(object sender, EventArgs e)
    {
    int index=((ListBox)sender).SelectedIndex;
    Index_Degistir(index);

    }
    private void Index_Degistir(int index)
    {

    foreach (ListBox a in _listbox)
    {
    if (a.Items.Count > index)
    {
    a.SelectedIndex = index;
    }

    }

    }


    Anlarsın diye yazmamıstım.Üstteki kodu kullandıgın formun kod yerine ekle."ListBoxIndex yeni = new ListBoxIndex(//buraya eklemek istedigin tüm listbox ları yaz); " ise nereye yazacagını biliyorsundur herhalde
    }




  • quote:

    Orijinalden alıntı: emg125

    private class ListBoxIndex
    {

    private ListBox[] _listbox;

    public ListBoxIndex(params ListBox[] deger)
    {

    _listbox = deger;

    foreach (ListBox list in deger)
    {

    list.SelectedIndexChanged += new EventHandler(Index_Change);

    }

    }

    private void Index_Change(object sender, EventArgs e)
    {
    int index=((ListBox)sender).SelectedIndex;
    Index_Degistir(index);

    }
    private void Index_Degistir(int index)
    {

    foreach (ListBox a in _listbox)
    {
    if (a.Items.Count > index)
    {
    a.SelectedIndex = index;
    }

    }

    }


    Anlarsın diye yazmamıstım.Üstteki kodu kullandıgın formun kod yerine ekle."ListBoxIndex yeni = new ListBoxIndex(//buraya eklemek istedigin tüm listbox ları yaz); " ise nereye yazacagını biliyorsundur herhalde
    }

    eyvallah hocam sağolun. Şuan müsait değilim yarın bi yapayım gelişme olursa bildiririm tekrar tekrar sağolun

    < Bu ileti mobil sürüm kullanılarak atıldı >




  • Yapay Zeka’dan İlgili Konular
    Daha Fazla Göster
    
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.