Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- using System.Collections;
- namespace TriListe
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- int i,j;
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void textBox1_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyData == Keys.Enter)
- {
- listBox1.Items.Add(textBox1.Text);
- textBox1.Clear();
- }
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void Rechercher(object sender, EventArgs e)
- {
- for (i = 0; i < listBox1.Items.Count; i++)
- {
- string s = listBox1.Items[i].ToString();
- if (s.Contains(textBox2.Text))
- {
- MessageBox.Show("Element trouvé " + i);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment