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 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 …
Jump to PostDim a, selected, prev As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load a = 1 selected = 0 End Sub a = a << ComboBox1.SelectedIndex If (Convert.ToBoolean(selected And a)) Then ComboBox1.SelectedIndex = prev Else selected = selected Or a a = …
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.