use both Mouse Down and Double click in listbox

Dears

I Have two challenges
1- I would like to use both Mouse Down and Double click in listbox .
2- If I want to have mouse down in certain columns and Double click in other columns in the same listbox… how to do it ???

See this thread https://forum.xojo.com/24219-mousedown-and-doubleclick where I give two different ways of obtaining both events.

It is posted in Web but the principle remains the same. Only, in the method using a timer, you do not need to create a class since Desktop already uses Timer.

Thanks Michel

You’re welcome.

Since MouseDown fires before double click, you can use X and Y available there to locate where the doubleclick happens. The easiest way to do that is to add a couple properties to the window, for instance ClickX and ClickY as Integr, which you set in MouseDown as such :

ClickX = X ClickY = Y

Then in each event you can check which column you are in and do something like

If ColumnFromXY(X,Y) = 0 then // Do what you need to do end if

In Doubleclick that becomes :

If ColumnFromXY(ClickX, ClickY) = 0 then // Do what you need to do end if