Suppose I have items in combobox1
1) On button click event ,I want to copy all the items to combobox2 ? What is the coding for this?
mansi sharma
7
Junior Poster in Training
Recommended Answers
Jump to PostYou can't just do a cbo1.items = cbo2.items
You will need to do somthing like:
Dim Value as string 'Im not sure if this should be a string For each Value in cbo2.Items cbo1.items.add(Value) Next
Jump to PostPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Item As String For Each Item In ComboBox1.Items With ComboBox2.Items .Add(Item) End With Next End Sub
All 5 Replies
ptaylor965
6
Junior Poster
Jx_Man
987
Nearly a Senior Poster
Featured Poster
mansi sharma
7
Junior Poster in Training
Jx_Man
987
Nearly a Senior Poster
Featured Poster
somu1205
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.