TextBoxBase.Undo 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
撤消最新的撤消命令。 换句话说,撤消撤消堆栈上最新的撤消单元。
public:
bool Undo();
public bool Undo();
member this.Undo : unit -> bool
Public Function Undo () As Boolean
返回
true 如果撤消操作成功,则为否则,为 false. 如果撤消堆栈为空,则此方法返回 false 。
示例
以下示例演示如何使用 Undo 该方法。
private void undoAction(object sender, RoutedEventArgs e)
{
if (myTextBox.CanUndo)
{
myTextBox.Undo();
}
}
Private Sub undoAction(ByVal sender As Object, ByVal e As RoutedEventArgs)
If myTextBox.CanUndo = True Then
myTextBox.Undo()
Else : Return
End If
End Sub