Results 1 to 3 of 3

Thread: Help needed: ActiveX drag, move method error

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    8

    Help needed: ActiveX drag, move method error

    I am generating an ActiveX control made up of labels, lines and images. I wish to be able to drag it around the screen.
    I found an elegant piece of code which works for command buttons in a standard Exe form but I can't get it to work for my UserControl. Below is the code I am using and can not get to complile without error.
    I am very new to VB6.

    As it wouldn't work I have tried using the ActiveX control interface method and can not find move or drag listed. I can add the move method but I still have errors when I try to compile and I can not add Drag as a new method because it comes up with "the member name you have created is already being used by the Extender Object". I have no idea what that means.

    Does ActiveX not support the methods below? If it does what am I missing? Can someone please point me in the right direction?

    "Object required" - error message appears on the UserControl.Drag vbBeginDrag line. I thought that the UserControl was the object so I don't understand what it wants.

    Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    UserControl.Drag vbBeginDrag
    End Sub
    'drops at top left corner of the control
    Private Sub Form_DragDrop(Source As Control, x As Single, y As Single)
    UserControl.Move x, y
    UserControl.Drag vbEndDrag
    End Sub

    It is rather a steep learning curve. I have searched the net and did not find much. Any help would be appreciated. Otherwise I will try other much longer winded methods to get around this one, I thought I might learn something anyway.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Help needed: ActiveX drag, move method error

    Check for typos in the name. Generally a usercontrol on a form is not named simply UserControl. By default, VB appends a number to the end, so it might look like UserControl1.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    8

    Re: Help needed: ActiveX drag, move method error

    just like Form I was under the impression that you had to use UserControl instead of the given name for the UserControl.

Tags for this Thread

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