?
Solved

Making an DBEdit field autoexit

Posted on 1997-09-06
2
Medium Priority
?
424 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
[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
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

765 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