次の方法で共有


DataDOMEvent.NewValue プロパティ

定義

データの入力規則イベントの間に更新または挿入されている XML DOM (Document Object Model) ノードの値を取得します。

public:
 property System::Object ^ NewValue { System::Object ^ get(); };
public object NewValue { get; }
member this.NewValue : obj
Public ReadOnly Property NewValue As Object

プロパティ値

次の例では、 オブジェクトの プロパティをOldValueDataDOMEventObject使用して、XML DOM ノードの元の値とその NewValue を表示します。

thisXDocument.UI.Alert("Original value: " + e.OldValue.ToString() + "\nNew value: " + e.<span class="label">NewValue</span>.ToString());

次の例では、DataDOMEventNewValue プロパティがブランク値かどうかを検査します。 ブランクでない場合は、"FirstName" フィールドと "Lastname" フィールドをクリアします。

 if (e.IsUndoRedo)
 {
  // An undo or redo operation has occurred and the DOM is read-only.
  return;
 }

 // A field change has occurred and the DOM is writable. Write code here to respond
 // to the changes.
 if (e.<span class="label">NewValue</span>.ToString() == "")
 return;

 if (thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Employees/@FirstName").text != "")
thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Employees/@FirstName").text = "";

 if (thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Employees/@LastName").text != "")
thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Employees/@LastName").text = "";

注釈

NewValue プロパティには、既存の値を置き換える XML DOM ノードの値が含まれます。 XML DOM ノードの元の値を取得するには、 プロパティを OldValue 使用します。

重要: このメンバーにアクセスできるのは、現在開いているフォームと同じドメインで実行されているフォーム、またはクロスドメインアクセス許可が付与されているフォームのみです。

適用対象