Home All Groups Group Topic Archive Search About

Drag and Drop controls during runtime in Windows App

Author
1 Dec 2006 10:03 PM
mattgcon
I was curiuos if anyone knew of a way to allow drag and drop
functionality on the actual controls themselves during runtime within a
Windows Application.

I want to allow the user to customize a report by moving textbox
controls and dropdown controls to locations of their liking.

Author
2 Dec 2006 4:04 AM
Cor Ligthert [MVP]
There is a property for that.

http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.allowdrop.aspx

Have a look at the given samples as well.

I hope this helps,

Cor

<mattg***@yahoo.com> schreef in bericht
Show quoteHide quote
news:1165010604.291874.6900@f1g2000cwa.googlegroups.com...
>I was curiuos if anyone knew of a way to allow drag and drop
> functionality on the actual controls themselves during runtime within a
> Windows Application.
>
> I want to allow the user to customize a report by moving textbox
> controls and dropdown controls to locations of their liking.
>
Author
4 Dec 2006 6:05 PM
mattgcon
I am aware of that proprerty, however after looking at the sample code,
it appear that they were dragging something onto the form, What I am
looking for is moving the actual controls that are on the form around
during run time.


Cor Ligthert [MVP] wrote:
Show quoteHide quote
> There is a property for that.
>
> http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.allowdrop.aspx
>
> Have a look at the given samples as well.
>
> I hope this helps,
>
> Cor
>
> <mattg***@yahoo.com> schreef in bericht
> news:1165010604.291874.6900@f1g2000cwa.googlegroups.com...
> >I was curiuos if anyone knew of a way to allow drag and drop
> > functionality on the actual controls themselves during runtime within a
> > Windows Application.
> >
> > I want to allow the user to customize a report by moving textbox
> > controls and dropdown controls to locations of their liking.
> >
Author
5 Dec 2006 2:33 PM
Brian Tkatch
mattg***@yahoo.com wrote:
Show quoteHide quote
> I am aware of that proprerty, however after looking at the sample code,
> it appear that they were dragging something onto the form, What I am
> looking for is moving the actual controls that are on the form around
> during run time.
>
>
> Cor Ligthert [MVP] wrote:
> > There is a property for that.
> >
> > http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.allowdrop.aspx
> >
> > Have a look at the given samples as well.
> >
> > I hope this helps,
> >
> > Cor
> >
> > <mattg***@yahoo.com> schreef in bericht
> > news:1165010604.291874.6900@f1g2000cwa.googlegroups.com...
> > >I was curiuos if anyone knew of a way to allow drag and drop
> > > functionality on the actual controls themselves during runtime within a
> > > Windows Application.
> > >
> > > I want to allow the user to customize a report by moving textbox
> > > controls and dropdown controls to locations of their liking.
> > >

On Mouse down set a flag. On Mouse move, if the flag is set, change the
x,y position. On mouse up, unset the flag.

B.