Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

combobox selection problem by various user preferences

$
0
0

I'm developing a program in vb.net that uses a form with comboboxes.   I would like for the user to have several options for selecting items in the combobox. 

1.  The user drops down the combobox and clicks on selection.

2.  The user drops down the combobox and types the first letter to advance through the list, scrolling up and down as desired, and then clicks on the selection.

3.  When the combobox has focus (but is not dropped down), the user up/down scrolls (and types in first letters to advance or reverse) until item is found, and then hits enter or tab to select.

When a new selection is made, a series of procedures is set in motion. 

The problem is this:   When I just use the SelectedIndexChanged event, the procedures are triggered every time the user scrolls up or down for each item he passes (as if each item is selected, triggering the procedures).  When he types a letter to advance in the list, the same thing occurs.  When the procedures are run, the combobox loses focus, because they trigger events in other controls.

I tried to solve the problem by not allowing the SelectIndexChanged event to occur unless the dropdown is closed and the box does not have focus, adding events for tab and enter and dropdownclosed.   When I do this, though, the procedures are run multiple times.  I have to keep the SelectedIndexChanged event, because other routines in my program trigger selections automatically.

Is there a setting for the combobox that allows the user to scroll through items without actually triggering the selectedindex event? 

Any insight would be helpful.  Thank you in advance.

Gina


Gina


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>