Gruppe
Dialog
Problem
Kopieren eines Textfeldinhalts und Übergabe an ein anderes Textfeld mit ShortCuts, wobei die hierfür vorgesehenen ShortCuts Strg+c und Strg+v nicht verwendet werden dürfen.
ClassModule: frmCopyPaste
Dim gBln As Boolean
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub txtSource_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim ClipAbLage As DataObject
Set ClipAbLage = New DataObject
If gBln And KeyCode = 116 Then
ClipAbLage.SetText txtSource.Text
ClipAbLage.PutInClipboard
End If
If KeyCode = 17 Then gBln = True Else gBln = False
End Sub
Private Sub txtTarget_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 120 Then SendKeys "+v"
End Sub
StandardModule: Modul1
Sub CallForm()
frmCopyPaste.Show
End Sub