Results 1 to 3 of 3

Thread: Problem with the OLEDragDrop Event of a UserControl

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    9

    Question Problem with the OLEDragDrop Event of a UserControl

    Dear Friends
    I´m creating an application where I was using an array of buttons which could be moved inside a PictureBox.
    This was made using the OLE Drag&Drop features of VB, and it was working just fine.
    But then, I needed something a little more sophisticated than a simple button, and the solution was to create my own UserControl.
    With the Command Button, I had an OLEDragDrop event that had these four arguments:
    Private Sub cmd_OLEDragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
    Index
    Source
    X
    Y

    In my usercontrol, I have mapped the OLEDragDrop RaiseEvent to the usercontrol OLEDragDrop event member.

    And now, the OLEDragDrop has these arguments:
    Private Sub cmd_OLEDragDrop(Index As Integer, Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Index
    Data
    Effect
    Button
    Shift
    X
    Y

    And this is the problem, because I needed the Source argument, and besides, I don´t even know how to fire this event anymore.

    Is there a way to create an OLEDragDrop event on a usercontrol that behaves just like the one in a command button?

    I´m lost in the desert with this problem, and any help will be of great value for me.

    Thanks in advance.
    Edit/Delete Message

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Problem with the OLEDragDrop Event of a UserControl

    Are you sure you posted that correctly?

    This code

    cmd_OLEDragDrop(Index As Integer, Source As Control, X As Single, Y As Single)

    is the event signature for a DragDrop event not the OLEDragDrop event.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    9

    Re: Problem with the OLEDragDrop Event of a UserControl

    Hey, thanks a lot
    That´s it.
    Some times we stick to one idea so hardly, and all it´s needed is someone else´s fresh mind to see our mistakes.
    I was so sure that this was an OLE thing, that I, not even for a second, considered verifying that point.

    Thanks a lot one more time.
    You really saved my day.

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