Solved

Jump automatically to next column in DBGrid

Posted on 2002-04-07
6
257 Views
Last Modified: 2010-04-04
Hi Experts,

One of my Delphi 5 applications has a DBGrid where article numbers should be entered. All article numbers are exactly 6 characters long.
What I want is, when a user enters an article number in the DBGrid, the cursor in the DBGrid automatically jumps to the next column when 6 characters have been entered. As far as I can see, all events in the DBGrid or in the Query are triggered when the Enter key is pressed. But I don't want to wait until the user presses the Enter key. As all article numbers are 6 characters long the DBGrid must automatically jump to the next column when the 6 characters are entered. And because this next column contains always 1 character, the DBGrid should jump to the third column when 1 character is entered in this column (without pressing the Enter key !!).

Is there a way to do this?

Thanks,
JDN
0
Comment
Question by:JDN
[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
  • 2
6 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 6924602
listening
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6925144
it's not too hard,
sample follows
(no delphi on hand yet,
but i've already done something like that)

meikl ;-)
0
 
LVL 1

Author Comment

by:JDN
ID: 6929555
Well Meikl,

Do you have a sample for me?

JDN
0
Independent Software Vendors: 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!

 
LVL 27

Accepted Solution

by:
kretzschmar earned 30 total points
ID: 6930600
well,
i've done it with another grid as the tdbgrid,
but basically it works like

in the onkeyup-event search for the tinplaceeditor-object,
there you've the selstart-property, which you can compare with the maxlength of the associated tfield,
if the values are equal, then perform a keybd_event call with the enter-key

a sample i can provide at friday,
since i've no time until then

meikl ;-)
0
 
LVL 1

Author Comment

by:JDN
ID: 6952716
Meikl,

Thanks for the advice (although the promised example would have been helpfull). Meanwhile I figured the thing it out myself using your suggestions.

I will be fair and give you the points.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6952724
ooops, sorry, had forgotten this q.

glad you got it work,
glad to helped you

meikl ;-)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

707 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