'宣言 Protected Overridable Sub OnValidateLabelEdit( _ ByVal e As ValidateLabelEditEventArgs _ )
protected virtual void OnValidateLabelEdit( ValidateLabelEditEventArgs e )
Imports Infragistics.Win.UltraWinTree Private Sub ultraTree1_ValidateLabelEdit(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.ValidateLabelEditEventArgs) Handles ultraTree1.ValidateLabelEdit Dim tree As Infragistics.Win.UltraWinTree.UltraTree tree = sender Dim sb As New System.Text.StringBuilder() sb.Append("Node: ") sb.Append(tree.ActiveNode.Key) sb.Append("'s text is being changed to: ") sb.Append(e.LabelEditText) Dim dr As DialogResult dr = MessageBox.Show(Me, _ sb.ToString(), _ "Node text changing", _ MessageBoxButtons.OKCancel) If dr = DialogResult.Cancel Then e.Cancel = True ' 注: 編集をキャンセルする代わりに、このイベントで ' イベント パラメーターの LabelEditText プロパティを設定すると、 ' テキストを変更できます 'e.LabelEditText = "新しいテキスト" End Sub
using System.Diagnostics; using Infragistics.Win.UltraWinTree; private void ultraTree1_ValidateLabelEdit(object sender, Infragistics.Win.UltraWinTree.ValidateLabelEditEventArgs e) { Infragistics.Win.UltraWinTree.UltraTree tree; tree = sender as Infragistics.Win.UltraWinTree.UltraTree; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("Node: "); sb.Append(tree.ActiveNode.Key); sb.Append("'s text is being changed to: "); sb.Append(e.LabelEditText); DialogResult dr = MessageBox.Show( this, sb.ToString(), "Node text changing", MessageBoxButtons.OKCancel ); if ( dr == DialogResult.Cancel ) e.Cancel = true; // 注: 編集をキャンセルする代わりに、このイベントで // イベント パラメーターの LabelEditText プロパティを設定すると、 // テキストを変更できます //e.LabelEditText = "新しいテキスト"; }