listbox help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dismantle
    New Member
    • Jan 2007
    • 11

    #1

    listbox help

    Hi guys i need help im working on a order form
    My probelm is Listbox1 shows the items and by clicking a Button item will be added to Listbox2 without erasing other items that i already added recently

    I found a source code
    Code:
    Dim lb As String = ListBox1.SelectedIndex
    Dim O As Object = ListBox1.Items(lb)
    ListBox2.Items.Add(O)
    The Problem of the code above is it only works if you manualy input items in listbox but when using databind you cant add the item to another listbox.
    When i tried to add the items a different message goes to my listbox2
    System.data.dat aRowView
    Last edited by Killer42; Mar 15 '07, 02:32 AM. Reason: Please use [CODE]...[/CODE] tags around your code.
  • vijaydiwakar
    Contributor
    • Feb 2007
    • 579

    #2
    Originally posted by dismantle
    Hi guys i need help im working on a order form
    My probelm is Listbox1 shows the items and by clicking a Button item will be added to Listbox2 without erasing other items that i already added recently

    I found a source code

    Dim lb As String = ListBox1.Select edIndex
    Dim O As Object = ListBox1.Items( lb)
    ListBox2.Items. Add(O)

    The Problem of the code above is it only works if you manualy input items in listbox but when using databind you cant add the item to another listbox.
    When i tried to add the items a different message goes to my listbox2
    System.data.dat aRowView
    put ur Q in proper forum

    Comment

    • dismantle
      New Member
      • Jan 2007
      • 11

      #3
      Originally posted by vijaydiwakar
      put ur Q in proper forum
      ermmm maybe ur the that is lost my question is about vb and this is the vb forum isnt it?

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by dismantle
        ermmm maybe ur the that is lost my question is about vb and this is the vb forum isnt it?
        It sure is, and I don't see any problem with your posting the question here. Although, depending on the version of VB you're using, it's possible you'll find a better response in the .Net forum.

        I don't know the solution to your problem, but as a workaround, have you tried looping through the items and moving them one by one?

        Comment

        Working...