Form.Deactivate Evento

Definição

Ocorre quando um formulário ativo se torna inativo.Occurs when an active form becomes inactive. Esta API está obsoleta.This API is obsolete. Para saber mais sobre como desenvolver aplicativos móveis ASP.NET, veja Mobile Apps & Sites with ASP.NET (Aplicativos móveis e sites com ASP.NET).For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public:
 event EventHandler ^ Deactivate;
public event EventHandler Deactivate;
member this.Deactivate : EventHandler 
Public Custom Event Deactivate As EventHandler 

Tipo de evento

EventHandler

Exemplos

O exemplo de código a seguir demonstra como interceptar o Deactivate evento para limpar o SelectionList .The following code example demonstrates how to trap the Deactivate event to clear the SelectionList. Este exemplo faz parte de um exemplo maior para a Form visão geral.This example is part of a larger example for the Form overview.

// When Form1 is deactivated
private void Form1_Deactivate(object sender, EventArgs e)
{
    count++;
}
' When Form1 is deactivated
Private Sub Form1_Deactivate(ByVal sender As Object, _
    ByVal e As EventArgs)

    count += 1
End Sub

Comentários

Um formulário se torna inativo nas seguintes circunstâncias:A form becomes inactive under the following circumstances:

  • Quando a ActiveForm propriedade da página é definida de forma programática para outro formulário.When the ActiveForm property of the page is programmatically set to another form.

  • Quando o usuário navega para um formulário por meio de um Link controle cujo destino é um formulário.When the user navigates to a form through a Link control whose target is a form.

Se nenhuma dessas ações ocorrer, o formulário ativo nunca receberá um Deactivate evento.If neither of these actions occurs, the active form will never receive a Deactivate event. A posição desse evento na cadeia de eventos torna muito importante a redefinição dos controles filho, do conjunto de dados ou das variáveis globais.This event's position in the event chain makes it very important in resetting the child controls, data set, or global variables.

Aplica-se a