The bottom line is to compare strings.Take the selected item in the combo box and compare it with all the strings in the list box.I am guessing you're conversant with programming in asp.net i.e vb.net or c#.I'll give u a code snippet in vb.net:
'assuming combo box=cbocombo and list box=lstlist
'this code runs in the combo box selectedindex changed event
Dim selectedstr as string=cbocombo.selecteditem.tostring
For i as integer= 0 to lstlist.items.count-1
Next
Sarama2030
Junior Poster in Training
74 posts since May 2009
Reputation Points: 10
Solved Threads: 4
The bottom line is to compare strings.Take the selected item in the combo box and compare it with all the strings in the list box.I am guessing you're conversant with programming in asp.net i.e vb.net or c#.I'll give u a code snippet in vb.net:
'assuming combo box=cbocombo and list box=lstlist
'this code runs in the combo box selectedindex changed event
Dim selectedstr as string=cbocombo.selecteditem.tostring
For i as integer= 0 to lstlist.items.count-1
if lstlist.items(i).tostring=selectedstr then
exit sub
Then
Next
lstlist.items.add(selectedstr)
.
Its something close to this but i'm not sure on the syntax for listbox methods the IDE
can help out hopefully
Sarama2030
Junior Poster in Training
74 posts since May 2009
Reputation Points: 10
Solved Threads: 4
there'a a typo in the code the if in the for loop should be closed by and end if not a then
Sarama2030
Junior Poster in Training
74 posts since May 2009
Reputation Points: 10
Solved Threads: 4