Controls [vb.net] TextBox Ctrl+c and Ctrl+v how to implement
페이지 정보
본문
Private Function SET_TEXT_BOX_CLIPBOARD_SHORTCUTS(ByRef f As Form) As Boolean
Dim C As Control = f
Do
C = f.GetNextControl(C, True)
Try
Select Case True
Case C Is Nothing
Case TypeOf C Is TextBox
AddHandler CType(C, TextBox).KeyUp, AddressOf TextBox_KeyUp
End Select
Catch ex As Exception
el.WriteToErrorLog(ex.Message, ex.StackTrace, "Error")
End Try
Loop Until C Is Nothing
End Function
Private Sub TextBox_KeyUp(sender As Object, e As KeyEventArgs)
Dim t As TextBox = CType(sender, TextBox)
If e.KeyData = (Keys.C Or Keys.Control) Then
t.Copy()
e.Handled = True
ElseIf e.KeyData = (Keys.X Or Keys.Control) Then
t.Cut()
e.Handled = True
ElseIf e.KeyData = (Keys.V Or Keys.Control) Then
t.Paste()
e.Handled = True
ElseIf e.KeyData = (Keys.A Or Keys.Control) Then
t.SelectAll()
e.Handled = True
ElseIf e.KeyData = (Keys.Z Or Keys.Control) Then
t.Undo()
e.Handled = True
End If
End Sub
- 이전글vb.net 컨트롤이 자신이 만들어진 스레드가 아닌 스레드에서 액세스되었습니다. 21.05.02
- 다음글[vb.net] JSON To DataTable 21.01.21
댓글목록
등록된 댓글이 없습니다.