TreeView.NodeMouseHover TreeView.NodeMouseHover TreeView.NodeMouseHover TreeView.NodeMouseHover Event

Definición

Se produce cuando se desplaza el mouse sobre un TreeNode.Occurs when the mouse hovers over a TreeNode.

public:
 event System::Windows::Forms::TreeNodeMouseHoverEventHandler ^ NodeMouseHover;
public event System.Windows.Forms.TreeNodeMouseHoverEventHandler NodeMouseHover;
member this.NodeMouseHover : System.Windows.Forms.TreeNodeMouseHoverEventHandler 
Public Custom Event NodeMouseHover As TreeNodeMouseHoverEventHandler 

Ejemplos

En el ejemplo de código siguiente se muestra el uso de este miembro.The following code example demonstrates the use of this member. En el ejemplo, un controlador de eventos informa sobre la aparición de la NodeMouseHover eventos.In the example, an event handler reports on the occurrence of the NodeMouseHover event. Este informe le servirá cuando el evento se produce y puede ayudarle a depurar.This report helps you learn when the event occurs and can assist you in debugging. Para informar sobre varios eventos o en eventos que se producen con frecuencia, considere reemplazar MessageBox.Show con Console.WriteLine o agregar el mensaje a un multilínea TextBox.To report on multiple events or on events that occur frequently, consider replacing MessageBox.Show with Console.WriteLine or appending the message to a multiline TextBox.

Para ejecutar el ejemplo de código, péguelo en un proyecto que contiene una instancia del tipo TreeView denominado TreeView1.To run the example code, paste it into a project that contains an instance of type TreeView named TreeView1. A continuación, asegúrese de que está asociado el controlador de eventos con el NodeMouseHover eventos.Then ensure that the event handler is associated with the NodeMouseHover event.

private void TreeView1_NodeMouseHover(Object sender, TreeNodeMouseHoverEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Node", e.Node );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "NodeMouseHover Event" );
}
Private Sub TreeView1_NodeMouseHover(sender as Object, e as TreeNodeMouseHoverEventArgs) _ 
     Handles TreeView1.NodeMouseHover

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Node", e.Node)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"NodeMouseHover Event")

End Sub

Comentarios

Si el mouse se encuentra sobre un TreeNode, NodeMouseHover se producirá el evento antes de la MouseHover eventos.If the mouse is located over a TreeNode, the NodeMouseHover event will occur before the MouseHover event.

Para obtener más información acerca de cómo controlar eventos, vea controlar y provocar eventos.For more information about how to handle events, see Handling and Raising Events.

Se aplica a