hello,
i've been struggeling with this for quite some time now.
I'm writing this program with a listbox. I retrieve items from an sql database and everything works well.
however, i want to implement some options for the items. therefor I use a popup menu in a doubleclickevent.
but the pop up also apears when clicking on whitespace.
I bet there must be a simple solution to my problem. I think I can best show my problem with a test:
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if BuildingBox.ItemAtPos(mouse.CursorPos,true) <> -1 then
showmessage(inttostr(mouse.CursorPos.x) + ' ' + inttostr(mouse.CursorPos.y));
end;
so here is a procedure which will trigger a showmessage as soon as the mouse would hover over a listbox item...
however... this doesn't happen.
Why do these coordinates not match?
I wanted to figure it out by myself, but I can't seem to find a function where the position of an item is returned giving the index.
I hope you have an answer to my problem!
thanks in advance