Solved

Disable Key press while in Listbox

Posted on 1997-04-23
1
591 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month8 days, 17 hours left to enroll

615 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