N
N
niklih132017-03-20 09:06:16
Windows
niklih13, 2017-03-20 09:06:16

How to search for input words in textBoxt and display the desired result in a WinForms form?

It is necessary to search for the words entered by the user in the desired textBoxt control and display the desired result in the WinForms form if the desired word is found.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Eremin, 2017-03-20
@niklih13

and what is the problem?
so far it looks like you are just asking to write for you
1. Create a form in the studio
2. Add a textBox and a button
3. When you click on the button, take text from the textBox and look for an entry in the list of predefined (or user-entered) strings
So far, nothing complicated
UPD : based on the fact that you have a sheetBox (it is more convenient), a textBox and a button, it turns out that this code

public Form1()
    {
      InitializeComponent();
    }

    private void button2_Click(object sender, EventArgs e)
    {
      string search = textBox2.Text;
      int index = listBox1.Items.IndexOf(search);
      listBox1.SelectedIndex = index;
    }
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question