Prevent double-click on the specific listbox row


Quick question.
Is there any way to prevent user from double-click the specific row in Listbox?

Thanks in advance.

The first thing that comes to mind is not to implement the DoubleClick event :wink:
I think you need to elaborate on that a bit.

Have a variable for the row that was last clicked. In the DoubleClick event check if that row is the one you want to ignore, and simply return.

Thank you. I couldn’t think of that.

Thanks again.

From the Online Help:
Add a new event for DoublClick:
Dim xValue As Integer
xValue = System.MouseX - Me.Left - Self.Left // Calculate current mouse position relative to top left of ListBox

Dim yValue As Integer
yValue = System.MouseY - Me.Top - Self.Top // Calculate current mouse position relative to top of ListBox.

Dim row, column As Integer
row = Me.RowFromXY(xValue, yValue)
column=Me.ColumnFromXY(xValue, yValue)

if row = 10 then
Call “whatever you want”
end if