|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
hello all,
I have a problem in Listview Control Events. In Earlier version Vb6 the Item Check event & DoubleClick Event were two Different events. Suppose i check the listview item it will call only ItemCheck event & Doubleclick event will call only Doubleclick event.But in .Net if i DoubleClick the item in listview it will first call the itemCheck event & then calls the DoubleClick event. So I need a solution where DoubleClicking the item should not call the ItemCheckEvent. It would be great help if you help in this regard. Thanks, LingarajaPatil |
|
#2
|
|||
|
|||
|
I had the same problem and worked around it by using a thread fired off from the ItemCheck event, and a global boolean value to act as a control like so -
In ItemCheck event - -Set global value to False -Create thread to do your routine and make it sleep for 100 miliseconds e.g. DoubleClicked = False Dim CheckComplete AsNew Threading.Thread(AddressOf ItemCheckRoutine) CheckComplete.Sleep(200) CheckComplete.Start() In DoubleClick event - -Set global value to True -Run normal routine (as a double click is not called with a ItemCheck so the check is one way) e.g. DoubleClicked = True In ItemCheckRoutine thread - - Check global value for double click event (set to True) and skip your code if it is. e.g. If DoubleClicked = False ' i.e. no double click event has occured 'Do your stuff End If It's not ideal, and it does cause a slight delay when the item checkbox is clicked (no delay for double click) but it's the only way i could think of getting around the problem If anyone has a better idea please let me know.Hope that makes sense and helps. Manub Quote:
|
|
#3
|
|||
|
|||
|
Hello, I’ve to solve nearly the same problem. You can see the C# solution there:
http://ncsystems.ru/en/programming/ListView_ItemCheck Best regards. Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Listview Events in VB.NET |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|