Re: List Boxes? and the Click event
"Bryan" <firstname.lastname@example.org> 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
>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
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.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL