?
Solved

Send KeyStrokes to controls

Posted on 1998-12-20
4
Medium Priority
?
483 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 150 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

801 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