Copy the data contents from a combo box to another combo
I have in my project a combo box(a) that in run time I must to copy to another combo box(b)
in the a combo box have items that are in the combo and also Itemdata to every item data
I succed to copy the items but not the Itemdata to every items
dim i as integer
For i = 0 To cboOperators(2).ListCount
newFrmStart(i).cboOperators(0).AddItem cboOperators(0).List(i)
newFrmStart(i).cboOperators(2).AddItem cboOperators(2).List(i)
Next i
Please advice how to copy thr itemdata in run time
Re: Copy the data contents from a combo box to another combo
VB Code:
'Generalized
For x = 0 To Combo1.ListCount - 1
Combo2.AddItem Combo1.List(x)
Combo2.ItemData(Combo2.NewIndex) = Combo1.ItemData(x)
Next
Re: Copy the data contents from a combo box to another combo
Quote:
Originally Posted by Static
VB Code:
'Generalized
For x = 0 To Combo1.ListCount - 1
Combo2.AddItem Combo1.List(x)
Combo2.ItemData(Combo2.NewIndex) = Combo1.ItemData(x)
Next
Hi Static
The code run fine thank you very much
Re: Copy the data contents from a combo box to another combo
Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful, or even particularly unhelpful, you have the ability to affect a their forum "reputation" by rating their post.