이 항목은 아직 평가되지 않았습니다.- 이 항목 평가

TextBoxBase.BeginChange 메서드

업데이트: 2007년 11월

변경 블록을 시작합니다.

네임스페이스:  System.Windows.Controls.Primitives
어셈블리:  PresentationFramework(PresentationFramework.dll)

public void BeginChange()
public void BeginChange()
public function BeginChange()
XAML에서 메서드를 사용할 수 없습니다.

참고:BeginChange를 호출할 때는 EndChange도 호출하여 변경 블록을 끝내야 합니다. 이렇게 하지 않으면 예외가 throw됩니다.

변경 블록은 여러 변경 내용을 하나의 실행 취소 단위로 논리적으로 그룹화하고, 변경 블록이 끝날 때까지 텍스트 내용 또는 선택 영역 변경 이벤트가 발생하지 않게 합니다. 따라서 다른 수신기에서 텍스트 요소를 동시에 변경할 위험 없이 텍스트 요소에 여러 편집을 적용할 수 있습니다. 변경 블록을 만들려면 DeclareChangeBlock 메서드를 호출합니다. BeginChange 메서드를 호출하면 해당 EndChange 메서드가 호출될 때까지 이후에 변경하는 모든 내용이 지정된 변경 블록에 포함됩니다.

다음 예제에서는 BeginChangeEndChange 메서드를 사용하여 변경 블록을 만드는 방법을 보여 줍니다.

TextBox myTextBox = new TextBox();

// Begin the change block. Once BeginChange() is called
// no text content or selection change events will be raised 
// until EndChange is called. Also, all edits made within
// a BeginChange/EndChange block are wraped in a single undo block.
myTextBox.BeginChange();

// Put some initial text in the TextBox.
myTextBox.Text = "Initial text in TextBox";

// Make other changes if desired...

// Whenever BeginChange() is called EndChange() must also be
// called to end the change block.
myTextBox.EndChange();


Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

.NET Framework

3.5, 3.0에서 지원
이 정보가 도움이 되었습니까?
(1500자 남음)

커뮤니티 추가 항목

추가
© 2013 Microsoft. All rights reserved.