开发者

C# Winforms ListView DoubleClick event anywhere

开发者 https://www.devze.com 2023-04-12 09:50 出处:网络
I\'m trying to get the following functionality in my winform: I开发者_如何学Python need so that every time a someone double clicks inside my ListView, something will happen, but the event seems to on

I'm trying to get the following functionality in my winform:

I开发者_如何学Python need so that every time a someone double clicks inside my ListView, something will happen, but the event seems to only trigger when double clicking on a row containing an item in the ListView instead of anywhere in the ListView (including the empty area below all the items).

What event will fire when double clicking anywhere in the ListView?

Thanks


you can used the ListView1_MouseDown event rather than click


You can probably achieve the required behavior by inheriting from ListView, and overriding the method OnNotifyMessage().

In that method, you'll have to intercept the correct message: WM_LBUTTONDBLCLK (or similar).

That's not going to be the prettiest code you've ever written, but should get you the results.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号