Solved

Jump automatically to next column in DBGrid

Posted on 2002-04-07
6
253 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
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Downloading email attachments 2 79
How to debug For loops? 3 57
Delphi and Access based Enumeration 9 70
DBGrid or StringGrid ? 6 105
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

829 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