How to block a double-click event in a ListView that has no items?

In my C # application, I have a ListView on the form. I want the user to double-click on the ListView item when no items are selected to open the New Item dialog. The problem is that the DoubleClick event for ListView fires only when an item is selected.

Is there any way to do this?

+3
source share
3 answers

There is a way to do this, but you need to perform low-level drilling on Windows machines. It is usually not recommended to spend a lot of time trying to force standard Windows control to behave in a non-standard way.

- " " ListView. , , "{ , " ", , .

+1

"" MouseDoubleClick.

0

Assuming Windows Forms:

Perhaps a good solution would be to use ContextMenu.

0
source

Source: https://habr.com/ru/post/1744518/


All Articles