RichTextBox.Redo 方法

定義

重新套用上次在控制項中被復原的作業。

public:
 void Redo();
public void Redo ();
member this.Redo : unit -> unit
Public Sub Redo ()

範例

下列程式碼範例示範如何使用 CanRedoRedoActionName 屬性和 Redo 方法,將重做作業限制為刪除文字以外的任何動作。 這個範例會要求您擁有包含 RichTextBox 控制項的表單,而且在呼叫此範例中的程式碼之前,已經執行並復原 中的 RichTextBox 作業。

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.CanRedo == true)
    {
        // Determines if the redo operation deletes text.
        if (richTextBox1.RedoActionName != "Delete")
            // Perform the redo.
            richTextBox1.Redo();
    }
}
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

備註

然後 Redo ,您可以使用 方法,將最後一個復原作業重新套用至 控制項。 方法 CanRedo 可讓您判斷使用者已復原的最後一個作業是否可以重新套用至控制項。

適用於

另請參閱