PropertyTabChangedEventArgs.OldTab Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene l'oggetto selezionato PropertyTab precedente.
public:
property System::Windows::Forms::Design::PropertyTab ^ OldTab { System::Windows::Forms::Design::PropertyTab ^ get(); };
public System.Windows.Forms.Design.PropertyTab OldTab { get; }
public System.Windows.Forms.Design.PropertyTab? OldTab { get; }
member this.OldTab : System.Windows.Forms.Design.PropertyTab
Public ReadOnly Property OldTab As PropertyTab
Valore della proprietà
Elemento precedente PropertyTab selezionato.
Esempio
Nell'esempio di codice seguente viene illustrato l'uso di questo membro. Nell'esempio un gestore eventi segnala l'occorrenza dell'evento PropertyGrid.PropertyTabChanged . Questo report consente di apprendere quando si verifica l'evento e di facilitare il debug. Per segnalare più eventi o eventi che si verificano frequentemente, è consigliabile sostituire MessageBox.Show con Console.WriteLine o accodare il messaggio a un oggetto multilinea TextBox.
Per eseguire il codice di esempio, incollarlo in un progetto contenente un'istanza di tipo PropertyGrid denominata PropertyGrid1. Assicurarsi quindi che il gestore eventi sia associato all'evento PropertyGrid.PropertyTabChanged .
private void PropertyGrid1_PropertyTabChanged(Object sender, PropertyTabChangedEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "OldTab", e.OldTab );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "NewTab", e.NewTab );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "PropertyTabChanged Event" );
}
Private Sub PropertyGrid1_PropertyTabChanged(sender as Object, e as PropertyTabChangedEventArgs) _
Handles PropertyGrid1.PropertyTabChanged
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "OldTab", e.OldTab)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "NewTab", e.NewTab)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"PropertyTabChanged Event")
End Sub