PropertyTabChangedEventArgs.OldTab プロパティ

定義

選択した古い PropertyTab を取得します。

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

プロパティ値

選択された古い PropertyTab

次のコード例は、このメンバーの使用方法を示しています。 この例では、イベント ハンドラーは、 PropertyGrid.PropertyTabChanged イベントの発生を報告します。 このレポートは、イベントがいつ発生するかを学習するのに役立ち、デバッグに役立ちます。 複数のイベントや頻繁に発生するイベントについて報告するには、 MessageBox.ShowConsole.WriteLine に置き換えるか、メッセージを複数行の TextBoxに追加することを検討してください。

コード例を実行するには、PropertyGridという名前の型のインスタンスを含むプロジェクトPropertyGrid1貼り付けます。 次に、イベント ハンドラーが 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

適用対象