ms access 2007 - How can I prevent ListBox from unselecting items after right click -
i have form there list box inside that. after selection of items (usually 20 items) , right click mouse on items should open pop form,the problem after right click selected items unselected except 1 item there mouse on that.
how can prevent list box deselecting items after right click .
the code mouse right click below:
private sub itemlist_mousedown(button integer, shift integer, x single, y single) const rightbutton = 2 dim udtpos pointapi dim frm access.form if button = rightbutton set mp = new [*clsmouseposition] getcursorpos udtpos docmd.openform "frmshortcut" docmd.movesize udtpos.x * mp.twipsperpixelx, udtpos.y * mp.twipsperpixely forms!frmshortcut!txtparameter = me.itemlist.value end if end sub
if multi select
property set simple
should not happening.
i assuming mutli select
set extended
, in case should press ctrl
button while right clicking item mouse keep existing selections left clicking.
in nutshell: right click same left click opens context menu.
Comments
Post a Comment