?
Solved

Making an DBEdit field autoexit

Posted on 1997-09-06
2
Medium Priority
?
432 Views
Last Modified: 2010-05-18
Is it possible to make a DBEdit field to automatically exit to the next field (like pressing tab) as soon as it is totally filled? DBASE used to do that automatically.
0
Comment
Question by:avj
2 Comments
 

Accepted Solution

by:
ptiemann earned 100 total points
ID: 1344166
yes, it is possible :-)
You have to write some eventhandler for the OnChange event. The following code exits to the next field when you have reached 12 characters.
You may derive your own component from TDBEdit that does this automatically so you don't have to code it for each control separately.

procedure TForm1.DBEdit1Change(Sender: TObject);
begin
  if length(DBEdit1.Text) = DBEdit1.Field.DataSize then
    PostMessage (Handle, WM_KEYDOWN, VK_TAB, 0);
end;

Note: Use PostMessage instead of SendMessage (which would not work)
0
 
LVL 4

Expert Comment

by:itamar
ID: 1344167
I'm also interested in the other solution therefore I'll repost this question for 25 points.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

864 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