Solved

Disable Key press while in Listbox

Posted on 1997-04-23
1
580 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi: how to implement a User Shortcut mapper? 1 121
HTML text in the body of an email (delphi code) 12 173
oracle global variables 4 76
Twebbrowser add css to the header 3 29
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

820 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