Occurs when the mouse pointer rests on the shape.
Assembly: Microsoft.VisualBasic.PowerPacks (in Microsoft.VisualBasic.PowerPacks.dll)
A typical use of MouseHover is to display a tooltip when the mouse pauses in a specified area around the shape (the hover rectangle). The pause required for this event to be raised is specified in milliseconds by the MouseHoverTime property.
Mouse events occur in the following order:
For more information about how to handle events, see Consuming Events.
The following example displays a message in the status bar when the mouse is moved over a shape. This example requires that you have a RectangleShape control named RectangleShape1 and a StatusStrip control named StatusStrip1 on a form. The StatusStrip must have a ToolStripStatusLabel named ToolStripStatusLabel1.
Private Sub RectangleShape1_MouseEnter(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles RectangleShape1.MouseEnter ToolStripStatusLabel1.Text = "The mouse has entered the shape." End Sub Private Sub RectangleShape1_MouseHover(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles RectangleShape1.MouseHover ToolStripStatusLabel1.Text = "The mouse is paused over the shape." End Sub Private Sub RectangleShape1_MouseLeave(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles RectangleShape1.MouseLeave ToolStripStatusLabel1.Text = "The mouse has left the shape." End Sub Private Sub RectangleShape1_MouseMove(ByVal sender As Object, _ ByVal e As System.Windows.Forms.MouseEventArgs) Handles _ RectangleShape1.MouseMove ToolStripStatusLabel1.Text = "The mouse is over the shape." End Sub
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.