Solved

Disable Key press while in Listbox

Posted on 1997-04-23
1
587 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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