Solved

Send KeyStrokes to controls

Posted on 1998-12-20
4
481 Views
Last Modified: 2011-09-20
I'm trying to program a Delphi-CodeInsight-like feature for my word-processor. I's just going well, I've got a listbox that shows at the cursorpos of my richedit-control. Now I'd like the selection of the listbox to change when the user presses the cursor up and down keys, but the other key should be sent to the richedit-component. Well, all in one, I'd just like to be able to send keystrokes to controls!
Does someone have a solution for this problem? I'm sure this isn't too hard, but I'm just too lazy to find out by myself, so get the bucks!
0
Comment
Question by:Metty
[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
  • 3
4 Comments
 

Author Comment

by:Metty
ID: 1352289
In addition to the functions above I want to set the SelectedItem of the ListBox to the Item, which matches the input best, so I want to send the pressed keys both to the Editor and the ListBox.
0
 
LVL 3

Accepted Solution

by:
Matvey earned 50 total points
ID: 1352290
Just use TControl.Perform:

  memo1.Perform(WM_CHAR, 70, 0);
  memo1.Perform(WM_KEYDOWN, VK_DOWN, 0);

The first one sends the message of the letter 'F' to the memo, and the seccond one send a "down arrow" message.

--Matvey
0
 

Author Comment

by:Metty
ID: 1352291
Ok, give me some time to check it and if the whole thing works, the points are yours!
0
 

Author Comment

by:Metty
ID: 1352292
That's it!

Thanxx.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

718 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