S
Steve
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.EventArgs) 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.ActiveControl, 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_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles tsmiDelete.Click
' Delete the selected text (if any) by initalizing the textbox.
If (TypeOf Me.ActiveControl Is TextBox) Then
Dim tb As TextBox = CType(Me.ActiveControl, TextBox)
If tb.SelectionLength > 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.EventArgs) 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.ActiveControl, 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_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles tsmiDelete.Click
' Delete the selected text (if any) by initalizing the textbox.
If (TypeOf Me.ActiveControl Is TextBox) Then
Dim tb As TextBox = CType(Me.ActiveControl, TextBox)
If tb.SelectionLength > 0 Then
tb.SelectedText = ""
End If
End If
End Sub