Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scroll 1 field more vertically 1

Status
Not open for further replies.

ukusa

Programmer
Oct 8, 2001
49
AU
Hi all,

I have a data entry screen which is very long (scrollbar range 6000 approx) and the users want to see the field directly under the one they are entering data into as an indication of what is coming next. I do come across a few others who can't stand entering data when the focused field is the last field at the bottom of the screen... They can scroll with the mouse to bring the "list" of fields to comfort them but...

How do I get the screen to sense movement going down and get it to progress the scrollbar etc to jump up the screen a little? Can't do it all on sensing Tab next as I have several fields stretching left to right for one item and don't need to get the screen to jump up as they are moving across.

Thanks in advance
Allen
 
Untested theory:

I'm presuming you're using a TDBCtrlGrid for your data entry.

Add an event to your TDataSet's AfterScroll event to compare your TDBCtrlGrid.PanelIndex to TDBCtrlGrid.PanelCount. If PanelIndex = PanelCount-1, then that means the current record is being shown on the bottom panel, and therefore needs to be scrolled up.

Not quite sure how to do the scroll efficiently, by try using the TDBCtrlGrid.ScrollBy method.

 
That's handy but no, not using a TDBCtrlGrid for the data. Just a standard panel with the scroll-box with holds all the data fields pasted all over it. The scroll-bar belongs to the scroll box. Thanks.
 
Hmmm, OK, got the auto scrolling part going with the Scrollby - thanks for that (mark for that), now I just have to isolated the tabbing on a set of fields that go across and not have the screen jump...

Thanks
 
How about using your Tab method, but get it to check the Tag property of the calling field control. If Tag=1 then scroll, otherwise don't (or the otherway around). This will allow you to have those multi-field lines left alone.

 
Yep, doing the code for that right now, thanks Griffyn!
 
Struth! How can we both miss a simpler solution! Just set the margin parameter on the scrollbox - about 30 for advancing the field list on the vertical scrollbar... Now I can see one field ahead of the focused one.

Cheers.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top