"Bryan" <bjs1117@ksu.edu> wrote:
>
>I am trying to use a list box to switch between databases. Everything works
>fine when I choose a database within the listbox by using the mouse but

when
>it comes to using the up and down arrow keys it won't let me scroll it just
>automatically loads the first database in the list.
>


The reason is that the Click event is also generated when the value in the
LIstBox changes, and when you use the arrow keys to move the selection, that
triggers the Click event.

From MSDN - "Click Event - Occurs when the user presses and then releases
a mouse button over an object. It can also occur when the value of a control
is changed."

I am not sure how to get around this a you do not know once you get into
the Click event what really triggered it. Off the top of my head I would
think you have to either document that as the correct behavior or change
it so that a double-click is used to kick off the action and a single click
only selects the item.