vb.net

VB Drag & Drop Files

From this question on Stack Overflow.

 

 

Imports System.Windows.Forms
 
Public Class Form1
 
    Private Sub TextBox1_DragEnter(ByVal sender As Object, ByVal e As DragEventArgs) Handles TextBox1.DragEnter
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            e.Effect = DragDropEffects.All
        End If
    End Sub
 
    Private Sub TextBox1_DragDrop(ByVal sender As Object, ByVal e As DragEventArgs) Handles TextBox1.DragDrop
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            Dim MyFiles() As String
            Dim i As Integer
            MyFiles = e.Data.GetData(DataFormats.FileDrop)
            TextBox1.Text = MyFiles(i)
        End If
    End Sub
 
End Class

More Randomer - one year at a time

It's been a full year since our company's code was posted to the daily wtf at more randomer (<-- link to the more randomer post).

dilbert on random numbers.

The creator of dosomethinghere.com saw the need for cupcakes, he also has a better comment on this occasion.

wtf cupcake

Syndicate content