ToolStripItem.TextChanged Evento
Definición
public:
event EventHandler ^ TextChanged;
public event EventHandler TextChanged;
member this.TextChanged : EventHandler
Public Custom Event TextChanged As EventHandler
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 del TextChanged evento.In the example, an event handler reports on the occurrence of the TextChanged 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 notificar varios eventos o eventos que se producen con frecuencia, considere MessageBox.Show la Console.WriteLine posibilidad de reemplazar por o anexar el TextBoxmensaje a una multilínea.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 código de ejemplo, péguelo en un proyecto que contenga una instancia de un tipo que herede de ToolStripItem, ToolStripButton como o ToolStripMenuItem.To run the example code, paste it into a project that contains an instance of a type that inherits from ToolStripItem, such as a ToolStripButton or ToolStripMenuItem. A continuación, asigne ToolStripItem1
un nombre a la instancia y asegúrese de que el TextChanged controlador de eventos está asociado al evento.Then name the instance ToolStripItem1
and ensure that the event handler is associated with the TextChanged event.
private void ToolStripItem1_TextChanged(Object sender, EventArgs e) {
MessageBox.Show("You are in the ToolStripItem.TextChanged event.");
}
Private Sub ToolStripItem1_TextChanged(sender as Object, e as EventArgs) _
Handles ToolStripItem1.TextChanged
MessageBox.Show("You are in the ToolStripItem.TextChanged event.")
End Sub
Comentarios
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.
Nota
Al cambiar Enabled la propiedad ToolStrip de, no se genera TextChanged el evento.Changing the Enabled property of a ToolStrip does not raise the TextChanged event. Genera este evento con valores de propiedad específicos.Raise this event with specific property settings.