Private Sub TextBox2_DragOver(ByVal sender As Object, ByVal e As DragEventArgs) Handles TextBox2.DragOver If e.Data.GetDataPresent(GetType(String)) Then 'Shift キーが押されていれば移動扱い/押されていなければコピー Dim IsShift As Boolean = CBool(ModifierKeys And Keys.Shift) If IsShift AndAlso CBool(e.AllowedEffect And DragDropEffects.Copy) Then e.Effect = DragDropEffects.Move ElseIf CBool(e.AllowedEffect And DragDropEffects.Copy) Then e.Effect = DragDropEffects.Copy End If Dim mousePos As Point = TextBox2.PointToClient(MousePosition) Dim caretPos As Integer = TextBox2.GetCharIndexFromPosition(mousePos) TextBox2.SelectionStart = caretPos TextBox2.Focus() End If End Sub Private Sub TextBox2_DragDrop(ByVal sender As Object, ByVal e As DragEventArgs) Handles TextBox2.DragDrop TextBox2.SelectedText = e.Data.GetData(GetType(String)) End Sub