Delphi 6 - TListView OnColumnRightClick Event get Incorrect Column Object
Posted on 2003-11-12
I have a Listview in my Application, it is displayed in Report Mode with ShowColumnHeaders set to True, I have code in the OnColumnRightClick Event which makes use of the Column Object,
But the Column Object Passed to the Event is incorrect if you have scrolled horizontally, Delphi seems to return the column which would have been there if you hadn't have scrolled.
Can't think of a way around this, thought maybe find out how far I have scrolled and then add up all the column widths and therefore being able to manually determine the column which was clicked - that didn't work because TListView does not expose the Scrollbars and I dont know how else to find out how far I have scrolled.
NOTE: OnColumnClick event dosn't have this problem but I already use this Event to sort my list view.