Results 1 to 2 of 2

Thread: DragDrop with Custom made ActiveX Control.

  1. #1
    ChuckB
    Guest

    DragDrop with Custom made ActiveX Control.

    Hello,
    I can program a VB control to drag and drop in run-time. This uses the form's DragDrop() event and the controls MouseDown() event.

    I have created a UserControl and saved it as .ocx file. I bring this custom control into another project. When I try same technique above for drag drop operation I notice that my custom made control has only 5 events: dragdrop, dragover, gotfocus, lostfocus and validate. I do not have the needed MouseDown() event.

    How do I:
    1) Add MouseDown event to my ActiveX control so it shows up as MouseDown when I reference it in other programs? OR
    2) Is there another technique then what I stated?

    I know that when I create ActiveX Control, the UserControl has a MouseDown event, but this does not show up in the final .ocx.
    I am know to ActiveX programming.

    Thanks,

  2. #2
    ChuckB
    Guest

    Solved Problem

    Hi,
    There were actually two problems.

    1) I created simple user control with text box, added

    Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Then I added RaiseEvent RaiseEvent MouseDown(Button, Shift, X, Y) inside the text1_mousedown event. So... I was able to drag and drop this user control in the other program. Nice!

    2) My user control is a pneumatic cylinder with a moveable piston and two electrical reed switches. I used the Shape control to build these. However, if you look at properties, I noticed that there were no drag properties related to Shapes. Aarrgg!

    So, I placed the cylinder (with all shapes), into a Image control. Image control does have Drag property.

    Problem solved.
    Chuck

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