RichTextBox.RedoActionName 屬性

定義

取得呼叫 Redo() 方法時可以再套用到控制項的動作的名稱。

public:
 property System::String ^ RedoActionName { System::String ^ get(); };
[System.ComponentModel.Browsable(false)]
public string RedoActionName { get; }
[<System.ComponentModel.Browsable(false)>]
member this.RedoActionName : string
Public ReadOnly Property RedoActionName As String

屬性值

String

字串,表示呼叫 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

備註

如果這個屬性傳回空字串 (「」) ,則沒有任何作業可供重新套用至控制項。 您可以使用這個方法來判斷控制項中 RichTextBox 復原的最後一 Redo 個動作,然後在呼叫 方法時重新套用至控制項。 您可以使用 屬性來判斷是否有任何要重新套用至控制項 CanRedo 的作業。

適用於

另請參閱