Hello! I wonder if someone can help me. I have a combobox named Requirements and The values of it come from sql. I want to ask how can I detect if I already selected one item to avoid selecting it again the next time I dropdown the combo box. Thank you very much and God Bless. :D
paulablanca
0
Junior Poster in Training
Recommended Answers
Jump to PostMaybe not the best way to do it, but...
You can set a variable equal to the selected value (would have to be global inside the class). Then in your
.SelectedIndexChanged
function, you can put your code inside anIf
statement that tests to see if the newly selected …
Jump to PostSee if this helps.
Public Class Form1 Private myCoolList As New List(Of Integer) '// List to store your SelectedIndexes. Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged If Not myCoolList.Contains(ComboBox1.SelectedIndex) Then '// check if not already added. myCoolList.Add(ComboBox1.SelectedIndex) '// add to list. Else …
All 5 Replies
bklynman01
2
Junior Poster in Training
paulablanca
0
Junior Poster in Training
codeorder
197
Nearly a Posting Virtuoso
paulablanca
0
Junior Poster in Training
prvnkmr194
0
Posting Whiz in Training
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.