Hello, i use VB.NET 2005 and NetAdvantage Vol2 CLR 2.0.
I use a WinGrid in my form. When i click in a row i don t do anything in my code. When I double click in a row i get some data from the selected row and i load some images in another form using multithreading. My problem is that while i m loading the images in the other form , i go back to my grid and (single) click in another row and the result is that the DoubleClick Event of the grid is fired,
Any opinion please ?
Hi,
If you can duplicate this behavior in a small sample project, we would be happy to look into it. But without seeing the behavior occur, all I can do is guess.
My guess here is that something your are doing in some event of the grid like one of the Mouse events or Click or DoubleClick is causing the messages to get out of synch. This kind of thing can happen if you are using Application.DoEvents, for example, which is one reason using that method is not recommended.
Another possibility is that the grid is doing something on the MouseDown, like setting some flag and something you are doing is making that flag uneccessary, but the grid is not correctly clearing it.
Did you ever get an answer to this? I have having the exact same problem... My grid double click works, but when it repaints with the new data, a single click fires the double click.
The interesting thing is that it is (in my case) a toggle. If I double click, on the replaint, a single click fires the double click code. When it repaints again, I need a double click again. The double click fires off a messagebox - if I tell it not to continue, then I have to double click to get it to fire again.
In my case, when you double click on an item, it goes out, looks it up, then displays it in the grid. This usually requires a refresh of the grid as the detail for the selected item is different than was shown previously.
Very weird. But so far, yours is the only post I have found about it.
JustMe2
Have you found a reason/resolution for that behavior?
Maybe you could trap the MouseDow/MouseUp events on the grid and display when they are firing and see if you can determine whether there's an extra or missing message. If there is an extra, you could check the call stack and see where it's coming from.
Hi, thanks.
Your guess is the only logical reason for this behavior. The only thing i can imagine is that my thread create an extra mouse click. Do you have any idea how i can find a solution for this ?
PS. This happens with both DoubleClick and DoubleClickRow Event