I have a form with a text box and a form with a list box. I would like to be able to push a button on the form with the text box and have it be added to a list box. any help?

Recommended Answers

this will do that:

ListBox1.Items.Add(TextBox1.Text)
Jump to Post

All 3 Replies

this will do that:

ListBox1.Items.Add(TextBox1.Text)

yes it is very simple, for example you have a formA having textbox and formB has a listbox , now put this coding at you button.

Try
            formB.listbox1.items.add(textbox1.text)
        Catch ex As Exception
            MsgBox(Err.Description)
        End Try

this will solve your prob .
Regards

thanks for the help :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.