Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Go Back  Xtreme Visual Basic Talk > > > Arrow Keys & Combobox Controls...


Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2005, 03:12 PM
BulletSponge's Avatar
BulletSponge BulletSponge is offline
Junior Contributor
 
Join Date: Aug 2005
Location: Orlando
Posts: 335
Angry Arrow Keys & Combobox Controls...


by default, arrow keys move between the items in the Combobox control.

WELL, lets say you want to use the arrow keys to LEAVE that control or do something instead of move through the items? What then?

I discovered (much to my dismay), that if I use;
Code:
Protected Overrides Function ProcessCmdKey(...) As Boolean Select Case keyData Case Keys.Right
Then the arrow keys do what I need.
But in order to prevent the arrow keys from CHANGING the value in the combobox as well, I had to add to each combobox;
Code:
Private Sub cbo_2_KeyUp(...) Handles cbo_2.KeyUp, cbo_2.KeyDown Select Case e.KeyData Case Keys.Up, Keys.Down, Keys.Left, Keys.Right e.Handled = True Case Else e.Handled = False End Select

Now, here's where it gets messy. A Combobox of type "Dropdownlist" operates just fine. HOWEVER, a Combobox of type "Dropdown" (where you can enter custom text) FIRES TWICE!

I've attached a sample app that shows you what I mean...

Is there any way to get the "Dropdown" type to only fire once?!


********** UPDATE *********** 10-21 @ 1:30PM est
of course there was a simple solution... No API, no subclassing.... NOTHING...
I finally know what the form's "KeyPreview" is for.

Resolution to the bane of my existence
Attached Files
File Type: zip ComboBox Test.zip (15.6 KB, 1 views)

Last edited by BulletSponge; 10-21-2005 at 12:18 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls... Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
 
Arrow Keys & Combobox Controls...
Arrow Keys & Combobox Controls...
 
-->