As is so often the case, after spending half a day and NOT getting past a problem, the moment you post about it something is likely to turn up:
1. I played some more with ItemAtPos and found that the strange
behaviour went away when I set the 'existing' parameter to false.
2. Reading through the source of stdctrls I found mention of a
property called 'topindex' - as you can guess what it contains it
is now fairly easy for me to calculate itemindex of any items even
when the list is scrolled.
An Aside:
3. I did not manage to transcend the source for TCustomListBox.ItemAtPos.
It sends messages to Windows and I feel out of my depth trying to intercept and debug that data. From what I can understand I can glean
absolutely no reason why it should start counting 0..1..2..3..4..5..5..6..6..7..8..(-1) after the listbox has been scrolled. Go
figure.
-Peter
--------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
- [DUG]: Passing DB Objects between DLLs James Low
- [DUG]: problems with TCustomListBox.ItemAtPos Peter Huebner
- Re: [DUG]: problems with TCustomListBox.ItemAtPo... Nello Sestini
- [DUG]: another question about DirListBox and Fil... Peter Huebner
- [DUG]: another question about DirListBox and... Peter Huebner
- RE: [DUG]: another question about DirLis... Donovan J. Edye
- RE: [DUG]: Passing DB Objects between DLLs vss
- RE: [DUG]: Passing DB Objects between DLLs James Low
- RE: [DUG]: Passing DB Objects between DLLs vss