Click here to Skip to main content
15,894,646 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Add filenames to list box Pin
johnjsm22-Dec-04 0:25
johnjsm22-Dec-04 0:25 
GeneralRe: Add filenames to list box Pin
johnjsm22-Dec-04 0:24
johnjsm22-Dec-04 0:24 
GeneralRe: Add filenames to list box Pin
Nicholas Cardi22-Dec-04 5:04
Nicholas Cardi22-Dec-04 5:04 
GeneralRe: Add filenames to list box Pin
johnjsm22-Dec-04 5:35
johnjsm22-Dec-04 5:35 
GeneralRe: Add filenames to list box Pin
Nicholas Cardi22-Dec-04 5:51
Nicholas Cardi22-Dec-04 5:51 
GeneralRe: Add filenames to list box Pin
johnjsm22-Dec-04 6:18
johnjsm22-Dec-04 6:18 
GeneralUsing drag and Drop picture to a label or something else for a scrabble game Im developing Pin
sourcezilla20-Dec-04 0:51
sourcezilla20-Dec-04 0:51 
GeneralRe: Using drag and Drop picture to a label or something else for a scrabble game Im developing Pin
Tom John20-Dec-04 2:28
Tom John20-Dec-04 2:28 
Here's how to drag an image back and forth between a couple of picture boxes:

Protected Overrides Sub OnLoad(ByVal e As EventArgs)

    PictureBox1.Image = Image.FromFile("MyImage.bmp")
    PictureBox1.AllowDrop = True
    PictureBox2.AllowDrop = True

End Sub

Private dragSource As PictureBox

Private Sub PictureBox_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) _
    Handles PictureBox1.MouseMove, PictureBox2.MouseMove

    'Initiate a drag if left mouse button is down
    If e.Button = MouseButtons.Left Then
        dragSource = CType(sender, PictureBox)
        DoDragDrop(CType(sender, PictureBox).Image, DragDropEffects.Move)
    End If

End Sub

Private Sub PictureBox_DragEnter(ByVal sender As Object, ByVal e As DragEventArgs) _
    Handles PictureBox1.DragEnter, PictureBox2.DragEnter

    If (Not dragSource Is Nothing) AndAlso (Not sender Is dragSource) Then
        e.Effect = DragDropEffects.Move
    End If

End Sub

Private Sub PictureBox_DragDrop(ByVal sender As Object, ByVal e As DragEventArgs) _
    Handles PictureBox1.DragDrop, PictureBox2.DragDrop

    If (Not dragSource Is Nothing) AndAlso (Not sender Is dragSource) Then
        CType(sender, PictureBox).Image = dragSource.Image
        dragSource.Image = Nothing
        dragSource = Nothing
    End If

End Sub
Hope this helps

Tom
GeneralResizing the Windows Form through code once it has been maximized Pin
Tweetyshwet19-Dec-04 23:12
Tweetyshwet19-Dec-04 23:12 
GeneralRe: Resizing the Windows Form through code once it has been maximized Pin
Tom John20-Dec-04 0:42
Tom John20-Dec-04 0:42 
GeneralRunning Bytes of array from memory Pin
matrixcine19-Dec-04 22:50
matrixcine19-Dec-04 22:50 
GeneralRe: Running Bytes of array from memory Pin
Dave Kreskowiak20-Dec-04 1:12
mveDave Kreskowiak20-Dec-04 1:12 
GeneralRe: Running Bytes of array from memory Pin
Anonymous20-Dec-04 2:17
Anonymous20-Dec-04 2:17 
GeneralRe: Running Bytes of array from memory Pin
Dave Kreskowiak20-Dec-04 3:31
mveDave Kreskowiak20-Dec-04 3:31 
Generalivr Pin
Geo Varghese19-Dec-04 22:21
Geo Varghese19-Dec-04 22:21 
GeneralRe: ivr Pin
Colin Angus Mackay20-Dec-04 1:58
Colin Angus Mackay20-Dec-04 1:58 
GeneralRE VB6 NETWORK SCRIPT Pin
sltan19-Dec-04 22:10
sltan19-Dec-04 22:10 
GeneralRe: RE VB6 NETWORK SCRIPT Pin
Nicholas Cardi20-Dec-04 6:05
Nicholas Cardi20-Dec-04 6:05 
GeneralBring a line or rectange to front Pin
Ehmed Owais19-Dec-04 21:35
Ehmed Owais19-Dec-04 21:35 
GeneralMove the Tab from one Field to Another Pin
loolita2719-Dec-04 21:29
loolita2719-Dec-04 21:29 
GeneralRe: Move the Tab from one Field to Another Pin
Tom John20-Dec-04 0:48
Tom John20-Dec-04 0:48 
GeneralRe: Move the Tab from one Field to Another Pin
loolita2720-Dec-04 20:56
loolita2720-Dec-04 20:56 
GeneralRe: Move the Tab from one Field to Another Pin
Deemo21-Dec-04 21:17
Deemo21-Dec-04 21:17 
GeneralRe: Move the Tab from one Field to Another Pin
Deemo22-Dec-04 9:46
Deemo22-Dec-04 9:46 
Generalmoving a button Pin
GaryKoh19-Dec-04 16:58
GaryKoh19-Dec-04 16:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.