Array Lİst Kavramı


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

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

        List<string> dersler = new List<string>();

        private void button1_Click(object sender, EventArgs e)
        {
            string ders = txtDersEkle.Text;
            dersler.Add(ders);
            lstDersListesi.Items.Add(ders);
            txtDersEkle.Text = string.Empty;
            //txtDersEkle.Clear();
            txtDersEkle.Focus();
        }

        private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
        {

            if (e.NewValue<dersler.Count && e.NewValue>0)
            {
                string eklenmisDers = dersler[e.NewValue];

                txtDersGöster.Text = eklenmisDers;
            }

            else

            {
                MessageBox.Show("hata");
            }
        }
    }
}

results matching ""

    No results matching ""