RichTextBox.RedoActionName RichTextBox.RedoActionName RichTextBox.RedoActionName RichTextBox.RedoActionName Property

定义

获取当调用 Redo() 方法后,可以重新应用到控件的操作名称。Gets the name of the action that can be reapplied to the control when the Redo() method is called.

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

属性值

一个字符串,表示发出对 Redo() 方法的调用后执行的操作名称。A string that represents the name of the action that will be performed when a call to the Redo() method is made.

示例

下面的代码示例演示如何使用CanRedoRedoActionName属性Redo以及方法将重做操作限制为除删除文本以外的任何操作。The following code example demonstrates how to use the CanRedo and RedoActionName properties, and the Redo method, to restrict a redo operation to any action except the deletion of text. 此示例要求您具有一个包含RichTextBox控件的窗体,并在调用此示例中的代码之前已执行并撤消了RichTextBox中的操作。This example requires that you have a form that contains a RichTextBox control and that an operation within the RichTextBox has been performed and undone before the code in this example is called.

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

注解

如果此属性返回一个空字符串(""),则没有可重新应用到该控件的操作。If this property returns an empty string (""), there is no operation available to reapply to the control. 您可以使用此方法来确定RichTextBox控件中撤消的最后一个操作,然后在调用Redo方法时重新应用于控件。You can use this method to determine the last action undone in the RichTextBox control that can then be reapplied to the control when a call to the Redo method is made. 您可以通过使用CanRedo属性来确定是否有任何操作重新应用到控件。You can determine whether there are any operations to be reapplied to the control by using the CanRedo property.

适用于

另请参阅