Page 2 of 2 FirstFirst 12
Results 41 to 46 of 46

Thread: [RESOLVED] Selection: Drag and Drop a PictureBox to a Panel

  1. #41
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: Selection: Drag and Drop a PictureBox to a Panel

    Are you event handlers clauses still intact?

    Code:
    Private Sub pictureBoxesArray_MouseDown(sender As Object, e As MouseEventArgs) Handles pic1.MouseDown, pi2.MouseDown, pic3.MouseDown, pic4.MouseDown, pic5.MouseDown, pic6.MouseDown, pic7.MouseDown,
                                                                                   pic8.MouseDown, pic9.MouseDown, pic10.MouseDown, pic11.MouseDown, pic12.MouseDown
    
        'code here
    End Sub
    
    Private Sub pictureBoxesArray_MouseMove(sender As Object, e As MouseEventArgs) Handles pic1.MouseMove, pic2.MouseMove, pic3.MouseMove, pic4.MouseMove, pic5.MouseMove, pic6.MouseMove, pic7.MouseMove,
                                                                                   pic8.MouseMove, pic9.MouseMove, pic10.MouseMove, pic11.MouseMove, pic12.MouseMove
    
        'code here
    End Sub
    
    
    Private Sub PanelDrop_DragEnter(sender As Object, e As DragEventArgs) Handles PanelDrop.DragEnter
        'code here
    End Sub
    
    
    Private Sub PanelDrop_DragDrop(sender As Object, e As DragEventArgs) Handles PanelDrop.DragDrop
        'code here
    
    End Sub

  2. #42

    Thread Starter
    Lively Member
    Join Date
    Aug 2017
    Location
    Brazil
    Posts
    87

    Re: Selection: Drag and Drop a PictureBox to a Panel

    They were note. I fixed already and it is working.
    Thank you.


    Is there a way to refresh the panel through Cancel button?

  3. #43
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: Selection: Drag and Drop a PictureBox to a Panel

    You mean clear the pictureboxes from the panel, and delete the dropped history?

    Code:
    Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
        PanelDrop.Controls.Clear()
        dropped.Clear()
        droppedIndices.Clear()
        pos = 10
    End Sub

  4. #44

    Thread Starter
    Lively Member
    Join Date
    Aug 2017
    Location
    Brazil
    Posts
    87

    Re: Selection: Drag and Drop a PictureBox to a Panel

    Thank You for the help.
    Sorry not answering earlier.


    I am with an idea in mind, but not sure how to use the orderlist to call the methods. As soon I finish the selection at that window I've been working on. The application will open the window related with the first method selected. In this second window the user should fill some information, and after he finishes he clicks a button, and just then the second method is called.

    Can I call the method from another form? Respecting this and the orderlist saved.

    THank you.

  5. #45
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: Selection: Drag and Drop a PictureBox to a Panel

    Do you know how to use dialog forms? The done button in your dialog just needs to set Me.DialogResult = DialogResult.OK

    To run the methods...
    Code:
    For x As Integer = 0 To dropped.count - 1
        dropped(x).caller.Invoke(dropped(x).index)
    Next
    opening the forms as dialog forms ensures they will run one after another instead of all of them popping up immediately.

    to show a dialog form and retrieve the values that were input, see...

    http://www.scproject.biz/Using%20Dialogs.php#bm11

    In that example, the Button's DialogResult is set in the designer, with btnOK being DialogResult.OK and btnCancel being DialogResult.Cancel

  6. #46

    Thread Starter
    Lively Member
    Join Date
    Aug 2017
    Location
    Brazil
    Posts
    87

    Re: Selection: Drag and Drop a PictureBox to a Panel

    Thank you!.. I will try to apply it later today.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width