PropertyTabChangedEventArgs.NewTab 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 il nuovo PropertyTab oggetto selezionato.
public:
property System::Windows::Forms::Design::PropertyTab ^ NewTab { System::Windows::Forms::Design::PropertyTab ^ get(); };
public System.Windows.Forms.Design.PropertyTab NewTab { get; }
public System.Windows.Forms.Design.PropertyTab? NewTab { get; }
member this.NewTab : System.Windows.Forms.Design.PropertyTab
Public ReadOnly Property NewTab As PropertyTab
Valore della proprietà
Oggetto appena selezionato PropertyTab.
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