Question Events

Deepakkumar D

New member
Joined
Feb 1, 2009
Messages
4
Programming Experience
1-3
Hi,

I am new to VB.NET, Now i'm working with Events in VB.NET, I have two event methods, Mouse Click and Mouse Down for a single button in a form, I have displyed a message in each of these methods but only mouse down event is triggered. Why Mouse Click is not triggered????????

Similiarly I Did the same for Mouse Enter and Mouse Move for a particular button , in this case both the events are triggered. Please tell me the reason for both the cases.

Regards,

New Worst Friend of VB.NET
 
The problem is that, for a MouseClick event to be raised, there must be a MouseDown and a MouseUp event raised first. Because you're displaying a MessageBox on the MouseDown event there is no MouseUp event, hence no MouseClick event.

You should use Console.WriteLine or Debug.WriteLine instead of MessageBox.Show. The messages will then be written to the Output window in VS and will not interfere with the normal flow of the application as MessageBoxes do.
 
Back
Top