Discussion:
Rightclick
Bernd Fröhlich
2018-05-03 13:24:20 UTC
Permalink
I feel like I´m missing something obvious here:

I would like to determine if a user clicked on a listbox row using the left or the right mousebutton but there is only a "CellClick" event. So how do I get the information which mousebutton was used?

Greetings from Germany,
Bernd Fröhlich
Christian Schmitz
2018-05-03 13:29:42 UTC
Permalink
Post by Bernd Fröhlich
I would like to determine if a user clicked on a listbox row using the left or the right mousebutton but there is only a "CellClick" event. So how do I get the information which mousebutton was used?
Put some code in CellClick:

if IsContextualClick then
// right
else
// left
end if



Sincerely
Christian
--
Read our blog about news on our plugins:

http://www.mbsplugins.de/
Bernd Fröhlich
2018-05-03 13:31:36 UTC
Permalink
Post by Christian Schmitz
if IsContextualClick then
// right
else
// left
end if
I knew it must be easy. Thank you :-)

Marnaud
2018-05-03 13:29:23 UTC
Permalink
Post by Bernd Fröhlich
I would like to determine if a user clicked on a listbox row using the left or the right mousebutton but there is only a "CellClick" event. So how do I get the information which mousebutton was used?
You have two ways:
In general, to know whether the user clicked with the right mouse button, you'd use the IsContextualClick method:

if IsContextualClick then
MsgBox "You right-clicked!"
end if

The other way, if you just want to show a contextual menu in your listbox, you can also use the ConstructContextualMenu event.
Markus Winter
2018-05-03 13:30:18 UTC
Permalink
A right-click triggers the ConstructContextualMenu event.

Take care

MfG

Markus

Sent from my iPad
Post by Bernd Fröhlich
I would like to determine if a user clicked on a listbox row using the left or the right mousebutton but there is only a "CellClick" event. So how do I get the information which mousebutton was used?
Greetings from Germany,
Bernd Fröhlich
Continue reading on narkive:
Loading...