Solved

Disable Key press while in Listbox

Posted on 1997-04-23
1
568 Views
Last Modified: 2010-04-16

      While using a ListBox component, if you press any key, "cursor" jumps to next Item starting with that key letter. For instance, if you press "B", it jumps to first Item starting with "B" letter. How to disable that feature?
0
Comment
Question by:biber
1 Comment
 
LVL 4

Accepted Solution

by:
erajoj earned 50 total points
ID: 1335691
The easiest way, I think, is to use method onKeyPress.
If you set the referenced "Key" to #0 (char(0)) then
none of the ascii characters typed will work in the listbox.
All other virtual keys (.., VK_UP, VK_DOWN, ...) will work
as they are supposed...

procedure TMainForm.ListBox1KeyPress(Sender: TObject; var Key: Char);
begin
  Key := #0; { Remove all keypresses }
end;

Hope this is what you're looking for!

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now