Solved

Making an DBEdit field autoexit

Posted on 1997-09-06
2
415 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

912 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now