TextBoxBase.CanRedo 屬性

定義

取得值,這個值表示是否能夠重新執行最近一個復原動作。Gets a value that indicates whether the most recent undo action can be redone.

public:
 property bool CanRedo { bool get(); };
public bool CanRedo { get; }
member this.CanRedo : bool
Public ReadOnly Property CanRedo As Boolean

屬性值

如果可以重新執行最近一個復原動作,則為 true,否則為 falsetrue if the most recent undo action can be redone; otherwise, false.

此屬性沒有預設值。This property has no default value.

範例

下列程式碼範例示範如何使用CanRedo屬性來判斷最近的復原動作是否可以重做。The following code example demonstrates how to use the CanRedo property to determine whether the most recent undo action can be redone.

private void redoAction(object sender, RoutedEventArgs e)
{
    if (myTextBox.CanRedo == true)
    {
        myTextBox.Redo();
    }
}
Private Sub redoAction(ByVal sender As Object, ByVal e As RoutedEventArgs)

    If myTextBox.CanRedo = True Then
        myTextBox.Redo()
    Else : Return
    End If
End Sub

適用於

另請參閱