Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help with drag drop.
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CodeMonkey2000




PostPosted: Wed Nov 21, 2007 9:40 pm   Post subject: Help with drag drop.

Okay, the drag drop event for a label looks like this:
code:
Private Sub label1_DragDrop(Source As Control, x As Single, Y As Single)
   
End Sub

My problem is how do I tell what the Source is?
I tried:
code:

if Source = label2 then

but as it turns out that is only comparing the caption properties (ie if I dragged over label3 which has the same caption as label2, then that if statement will be true). How do I verify that source is actually label2? Is there a property that is unique to all controls ? (and name doesn't work if you have an array of controls)
Sponsor
Sponsor
Sponsor
sponsor
Brightguy




PostPosted: Sat Nov 24, 2007 5:39 pm   Post subject: Re: Help with drag drop.

If it's part of a control array, then you can use the Index property to distinguish between controls. Also, you could make the Tag property unique to all controls, as a hack.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: