Metin İçinde Kelime Bulma Uygulaması

 Metin İçinde Kelime Bulma Uygulaması

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 müşteri_bulma
{
    public partial class Form1 : Form
    {
        //müşterileri sorguluyo
        public void musteriarama()
        {
            string kelim = textBox1.Text;
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                if (listBox1.Items[i].ToString() == kelim)
                {
                    MessageBox.Show(listBox1.Items[i].ToString() + " adlı kelime bulundu..!!");
                    break;
                }
               
            }
        }

        //split kullanımıyla isimleri ayırarak ekleme yapıyor
        public void musteriekleme()
        {
            string cuml;
            string[] sec;
            cuml = richTextBox1.Text;
            sec = cuml.Split(' ');
            foreach (string kelimeler in sec)
            {
                listBox1.Items.Add(kelimeler);
            }
        }
        public Form1()
        {
            InitializeComponent();
        }

        private void label2_Click(object sender, EventArgs e)
        {
            musteriekleme();
           
        }

        private void label1_Click(object sender, EventArgs e)
        {
            musteriarama();
        }
    }
}

 

 

Yorumunuzu Ekleyin


Yükleniyor...
Yükleniyor...