Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

programing in visual basic?

three listbox are in the form list1 an list2 contains some items concatenate both item and add selected items(from list1 and list2 ) into list3.....i have tried allot but none output is executing

2 Answers

Relevance
  • 1 decade ago

    I assume you're using the Visual Studio .NET form builder to add your controls to the form. What you probably want to do is add an event handler to list1 and list2 that will allow you to update list3 whenever their selections change.

    You could try something like this, but it may not work straight out of the box:

    Private Sub ConcatenateSelections() Handles list1.SelectedIndexChanged, list2.SelectedIndexChanged

    list3.Items.Clear()

    For Each list1Item As Object In list1.SelectedItems

    list3.Items.Add(list1Item.ToString())

    Next

    For Each list2Item As Object In list2.SelectedItems

    list3.Items.Add(list2Item.ToString())

    Next

    list3.TopIndex = 0

    End Sub

  • 1 decade ago

    SO WHAT'S YOUR QUESTION? I SEE NO QUESTION MARKS

Still have questions? Get your answers by asking now.