PropertyValueChangedEventArgs Classe

Definição

Fornece dados para o PropertyValueChanged evento de um PropertyGrid.

public ref class PropertyValueChangedEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class PropertyValueChangedEventArgs : EventArgs
[<System.Runtime.InteropServices.ComVisible(true)>]
type PropertyValueChangedEventArgs = class
    inherit EventArgs
Public Class PropertyValueChangedEventArgs
Inherits EventArgs
Herança
PropertyValueChangedEventArgs
Atributos

Exemplos

O seguinte exemplo de código demonstra o uso deste tipo. No exemplo, um gestor de eventos reporta a ocorrência do PropertyValueChanged evento. Este relatório ajuda-o a saber quando o evento ocorre e pode ajudá-lo na depuração. Para reportar múltiplos eventos ou eventos que ocorrem frequentemente, considere substituir Show ou Console.WriteLine anexar a mensagem a uma multilinha TextBox.

Para executar o código de exemplo, cole-o num projeto que contenha uma instância do tipo PropertyGrid chamada PropertyGrid1. Depois, certifique-se de que o gestor de eventos está associado ao PropertyValueChanged evento.

private void PropertyGrid1_PropertyValueChanged(Object sender, PropertyValueChangedEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ChangedItem", e.ChangedItem );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "OldValue", e.OldValue );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "PropertyValueChanged Event" );
}
Private Sub PropertyGrid1_PropertyValueChanged(sender as Object, e as PropertyValueChangedEventArgs) _ 
     Handles PropertyGrid1.PropertyValueChanged

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

End Sub

Observações

O PropertyValueChanged evento ocorre quando o utilizador altera o valor de uma propriedade, que é especificada como um GridItem, num PropertyGrid.

Para obter mais informações sobre como manipular eventos, consulte Manipulando e gerando eventos.

Construtores

Name Description
PropertyValueChangedEventArgs(GridItem, Object)

Inicializa uma nova instância da PropertyValueChangedEventArgs classe.

Propriedades

Name Description
ChangedItem

Percebe que GridItem isso foi alterado.

OldValue

O valor do item da grelha antes de ser alterado.

Métodos

Name Description
Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetHashCode()

Serve como função de hash predefinida.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do atual Object.

(Herdado de Object)
ToString()

Devolve uma cadeia que representa o objeto atual.

(Herdado de Object)

Aplica-se a