Link to home
Start Free TrialLog in
Avatar of ttrobin
ttrobin

asked on

Scrollbar and DBGrid

Hi,

The question is quite simple, but not the answer i guess (not for me i mean): I want the scrollbar in a dbgrid doesn't move when i click on a record, and be able to move the scrollbar keeping the record that is selected, viewing the whole list in the dbgrid.

I hope have well explained, sorry my english.
Avatar of Amir Azhdari
Amir Azhdari
Flag of United States of America image

Hi, try to work with these functions :

EnableScrollBar
GetScrollPos
GetScrollInfo
GetScrollRange
ScrollDC
ScrollWindow
ScrollWindowEx
SetScrollInfo
SetScrollPos
SetScrollRange
ShowScrollBar

Regards
Azhdari
Avatar of ttrobin
ttrobin

ASKER

hi Azhdari,

I have tried the functions u gave me, but they doesnt work the way i want. I can move the scrollbar to the position i want, but the dbgrid list doesnt scroll at the same time, and doesnt keep the focused record...

Thanx anyway but, someone else have any idea?
thats not so easy, just because if you scroll the
scrollbar the grid scrolls the dataset as well,
which causes that other records become currentrecord

my advice would be to use a bookmark as pointer
to your "currentrecord", then you can easily return
to your record with the gotobookmark-method

just as suggestion

meikl ;-)
Avatar of ttrobin

ASKER

Hi kretzschmar,

Bookmark doesnt work as i wish. Thnx anyway

Any help please!!! :)
ASKER CERTIFIED SOLUTION
Avatar of cula99
cula99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial