I have created my own context menu. Everything works except undo'ing
deleted text. My code for these two events are:
Private Sub tsmiUndo_Click( ByVal sender As Object, ByVal e As
System.EventArg s) Handles tsmiUndo.Click
' Undo the last thing the user did and clear the undo buffer to make
sure that clicking
' Undo again doesn't redo the last thing undone.
Dim tb As TextBox = CType(Me.Active Control, TextBox)
If tb.CanUndo = True Then
tb.Undo()
tb.ClearUndo()
End If
Does anyone have an idea of why this doesn't work?
Thanks
Steve
End Sub
Private Sub tsmiDelete_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s) Handles tsmiDelete.Clic k
' Delete the selected text (if any) by initalizing the textbox.
If (TypeOf Me.ActiveContro l Is TextBox) Then
Dim tb As TextBox = CType(Me.Active Control, TextBox)
If tb.SelectionLen gth 0 Then
tb.SelectedText = ""
End If
End If
End Sub
deleted text. My code for these two events are:
Private Sub tsmiUndo_Click( ByVal sender As Object, ByVal e As
System.EventArg s) Handles tsmiUndo.Click
' Undo the last thing the user did and clear the undo buffer to make
sure that clicking
' Undo again doesn't redo the last thing undone.
Dim tb As TextBox = CType(Me.Active Control, TextBox)
If tb.CanUndo = True Then
tb.Undo()
tb.ClearUndo()
End If
Does anyone have an idea of why this doesn't work?
Thanks
Steve
End Sub
Private Sub tsmiDelete_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s) Handles tsmiDelete.Clic k
' Delete the selected text (if any) by initalizing the textbox.
If (TypeOf Me.ActiveContro l Is TextBox) Then
Dim tb As TextBox = CType(Me.Active Control, TextBox)
If tb.SelectionLen gth 0 Then
tb.SelectedText = ""
End If
End If
End Sub
Comment