|
-
Mar 18th, 2012, 09:21 PM
#1
Thread Starter
New Member
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.
-
Mar 19th, 2012, 04:14 PM
#2
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.
-
Mar 21st, 2012, 09:32 PM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|