0

I have a ListBox that contains some names from a database query.

How can I retrieve these names when selecting multiple items?

1
  • 3
    Windows? Mac? iPhone? Android? Web? ... C# is used in so many environments, please specify in the tags what platform are you using... and if you are talking in Database, what ORM are you using. Commented Apr 19, 2011 at 7:27

1 Answer 1

3

Here's a sample code see it

  private void button1_Click(object sender, System.EventArgs e)
    {
        String strItem;
        foreach(Object selecteditem in listBox1.SelectedItems)
        {
            strItem = selecteditem as String;
            System.Diagnostics.Debug.WriteLine(strItem);
            //Process(strItem);
        }
    }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.