.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 6th, 2004, 05:31 AM
lingarajapatil lingarajapatil is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 lingarajapatil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Listview Events in VB.NET

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

Reply With Quote
  #2  
Old April 6th, 2005, 10:30 AM
manub manub is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 1 manub User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 44 sec
Reputation Power: 0
Red face

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:
Originally Posted by lingarajapatil
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

Reply With Quote
  #3  
Old April 24th, 2005, 02:52 PM
ncsystems ncsystems is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 1 ncsystems User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 6 m 40 sec
Reputation Power: 0
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:
Originally Posted by lingarajapatil
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Listview Events in VB.NET


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT