다음을 통해 공유


RichTextBox.Redo 메서드

컨트롤에서 실행 취소한 마지막 작업을 다시 적용합니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
Public Sub Redo
‘사용 방법
Dim instance As RichTextBox

instance.Redo
public void Redo ()
public:
void Redo ()
public void Redo ()
public function Redo ()

설명

그런 다음 Redo 메서드를 사용하여 마지막 실행 취소 작업을 컨트롤에 다시 적용할 수 있습니다. CanRedo 메서드를 사용하면 실행 취소한 마지막 작업을 컨트롤에 다시 적용할 수 있는지 여부를 확인할 수 있습니다.

예제

다음 코드 예제에서는 CanRedoRedoActionName 속성과 Redo 메서드를 사용하여 다시 실행 작업을 텍스트 삭제 이외의 모든 작업으로 제한하는 방법을 보여 줍니다. 이 예제를 실행하려면 RichTextBox 컨트롤이 포함된 폼이 있어야 하고 이 예제의 코드를 호출하기 전에 RichTextBox에서 작업을 수행한 후 실행 취소한 상태여야 합니다.

Private Sub RedoAllButDeletes()

    ' Determines if a Redo operation can be performed.
    If richTextBox1.CanRedo = True Then
        ' Determines if the redo operation deletes text.
        If richTextBox1.RedoActionName <> "Delete" Then
            ' Perform the redo.
            richTextBox1.Redo()
        End If
    End If
End Sub
private void RedoAllButDeletes()
{
    // Determines if a Redo operation can be performed.
    if(richTextBox1.CanRedo == true)
    {
        // Determines if the redo operation deletes text.
        if (richTextBox1.RedoActionName != "Delete")
            // Perform the redo.
            richTextBox1.Redo();
    }
}
private:
   void RedoAllButDeletes()
   {
      // Determines if a Redo operation can be performed.
      if ( richTextBox1->CanRedo == true )
      {
         // Determines if the redo operation deletes text.
         if (  !richTextBox1->RedoActionName->Equals( "Delete" ) )
         // Perform the redo.
         richTextBox1->Redo();
      }
   }
private void RedoAllButDeletes()
{
    // Determines if a Redo operation can be performed.
    if (richTextBox1.get_CanRedo() == true) {
        // Determines if the redo operation deletes text.
        if (!(richTextBox1.get_RedoActionName().Equals("Delete"))) {
            // Perform the redo.
            richTextBox1.Redo();
        }
    }
} //RedoAllButDeletes

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

참고 항목

참조

RichTextBox 클래스
RichTextBox 멤버
System.Windows.Forms 네임스페이스
CanRedo