Help with dragging and dropping 
Author Message
 Help with dragging and dropping

==============================================================================
I am a frantic final year electrical engineering student. My project involves w
writing a student training aid using Visual Basic.
My problem is that I want to drag controls from one child form to another. The
form of the controls are text windows, graphic boxes etc. I have mastered
dragging and dropping within a form, but can not find a way to achieve this
between forms.
If you have any advice I would be very grateful as the deadline draws ever
closer.
Thanks in advance
Stephen



Tue, 26 Aug 1997 18:42:09 GMT  
 Help with dragging and dropping

says:

Quote:

>========================================================================
======
>I am a frantic final year electrical engineering student. My project
involves w
>writing a student training aid using Visual Basic.
>My problem is that I want to drag controls from one child form to
another. The
>form of the controls are text windows, graphic boxes etc. I have
mastered
>dragging and dropping within a form, but can not find a way to achieve
this
>between forms.

Yes, you *can* do this. But you can only drag and drop controls which
exist on both forms. This is because, to some extent, you fake it.

What you do is drag the control across from the source form to the
destination and drop it. Easy, so far. This will give you a drop event on
the target form. You then use typeof to see what got dropped on you and
the 'load' verb to clone a copy of the control. You'll need one of each
possible drop control on the target form, they can be invisible and
disabled of course, and I recommend giving them each an index property of
0.

When you clone the new control you make it appear at the position that
you got the drop event, and size it identically to the control that got
dropped on you.

It *does* work, believe me, I use it all the time.



Fri, 29 Aug 1997 09:29:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need Help With Drag and Drop

2. Help with Drag and Drop?

3. Help with Drag and Drop

4. Need help With Drag and Drop

5. help with drag and dropping

6. Need help with drag and drop

7. help with drag and drop

8. help with Drag and Drop and making various Thumbnails

9. Help with drag and drop and UserControl

10. Help needed : Drag and Drop

11. Want help on Drag And Drop!!!

12. Need help with drag and drop

 

 
Powered by phpBB® Forum Software