ToolStripControlHost.GotFocus Event

Definition

Se produce cuando el control hospedado recibe el foco.Occurs when the hosted control receives focus.

public:
 event EventHandler ^ GotFocus;
[System.ComponentModel.Browsable(false)]
public event EventHandler GotFocus;
member this.GotFocus : EventHandler 
Public Custom Event GotFocus As EventHandler 
Attributes

Examples

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 del evento GotFocus.In the example, an event handler reports on the occurrence of the GotFocus event. Este informe le ayuda a saber cuándo se produce el evento y puede ayudarle a depurar.This report helps you to learn when the event occurs and can assist you in debugging.

Para ejecutar el código de ejemplo, péguelo en un proyecto que contenga una instancia de tipo ToolStripControlHost denominada ToolStripControlHost1.To run the example code, paste it into a project that contains an instance of type ToolStripControlHost named ToolStripControlHost1. A continuación, asegúrese de que el controlador de eventos está asociado al evento GotFocus.Then ensure that the event handler is associated with the GotFocus event.

private void ToolStripControlHost1_GotFocus(Object sender, EventArgs e) {

   MessageBox.Show("You are in the ToolStripControlHost.GotFocus event.");
}
Private Sub ToolStripControlHost1_GotFocus(sender as Object, e as EventArgs) _ 
     Handles ToolStripControlHost1.GotFocus

Console.WriteLine("You are in the ToolStripControlHost.GotFocus event.")

End Sub

Remarks

Para obtener más información sobre el manejo de eventos, consulte controlar y provocar eventos.For more information about handling events, see Handling and Raising Events.

Applies to

See also