Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ItemClick event (Read 1672 times)
mog_ur
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Jul 3rd, 2007
ItemClick event
Jul 23rd, 2007 at 10:37am
Print Post  
Hello

When I put this code at ItemClick event

If e.Clicks = 2 Then
If e.Button = MouseButtons.Left Then
MsgBox("hello") 'This is a sample
End If
Else


The item start drag automatically


¿What is the problem?

Thanks
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ItemClick event
Reply #1 - Jul 23rd, 2007 at 11:46am
Print Post  
This happens because the ItemClick event is fired when the mouse is pressed down on an item (but not released). At the other hand, pressing down the mouse over an item starts a drag operation of this item. To prevent this, you have to cancel the drag operation from within the event handler before displaying the message box. Here is a sample:

If e.Clicks = 2 Then
    If e.Button = MouseButtons.Left Then
       calendar.ResetDrag()
       MsgBox("hello") 'This is a sample
    End If
End If


Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint