double clicking on listbox item

I have code to search for extensions in a listbox item when the item is double clicked. However, the DoubleClick event won’t fire the code correctly. In fact, it does nothing.

My Code:

[code] Dim TheExtension As String
TheExtension = ArchiveFileList.Text

If InStr(".brstm", TheExtension) > 0 Then
Dim BrstmEditor As New EditorBrstm
BrstmEditor.EmbedWithinPanel(EditorPanel, 0)
End If[/code]

What method do I use to fire this?

I think you’re code has the flaw

If InStr(".brstm", TheExtension) > 0 Then

will look for the value in TheExtension in “.brstm” which I think is the reverse of what you want
Try

If InStr( TheExtension, ".brstm") > 0 Then

In addition to this, you may need to

return true

in the mouseDown event handler as well. That might explain the “nothing happening” situation as well… It can’t hurt.

[quote=43386:@Norman Palardy]I think you’re code has the flaw

If InStr(".brstm", TheExtension) > 0 Then

will look for the value in TheExtension in “.brstm” which I think is the reverse of what you want
Try

If InStr( TheExtension, ".brstm") > 0 Then

Thanks for finding it. The code now works perfectly.

[quote=43391:@Christopher Ridgeway]In addition to this, you may need to

return true

in the mouseDown event handler as well. That might explain the “nothing happening” situation as well… It can’t hurt.[/quote]
The reverse is true. If you do return true in MouseDown, doubleclick will hever happen.