can anyone tell me examples of 3 mouse events(which will be easiest to create) and 3 keyboard events(which will be easiest to create) please! ASAP

Recommended Answers

All 2 Replies

There are multiple Mouse events.

Here is the order that the click events fire in.

MouseDown
MouseClick
MouseUp

Examples:

Private Sub MouseDownMe(sender as object, e as MouseEventArgs) handles Me.MouseDown
        MsgBox("You have clicked the mouse.")
End Sub

Private Sub MouseClickMe(sender as object, e as MouseEventArgs) handles Me.MouseClick
If e.Button = Windows.Forms.MouseButton.Left Then
    MsgBox("You have clicked the left mouse button.")
End If
End Sub


Private Sub MouseUpMe(sender as object, e as MouseEventArgs) handles Me.MouseUp
    MsgBox("You have released the mouse button."
End Sub

For the case of keyboard events you may use this
on keyUp
on keyDown
on keyPress

I would like to show you the real codes and even some examples on that, but the current PC that I'm using rightnow doesn't have VB.NET installed. If possible tomorrow I will show you my friend.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.