PDA

Click to See Complete Forum and Search --> : Drag and Drop


AlphaScorpious
Mar 13th, 2006, 11:49 PM
How do you implement Drag and Drop for Pocket PC? The standard .NET Drag and Drop functions don't work - I've created a windows form with 2 picture box controls and pasted the code example from MSDN into the form and it works. The same form created for a Smart Device with the same controls does not.

petevick
Mar 14th, 2006, 01:13 AM
Hi,
drag and drop is not supported in CF

Sorry

Shaggy Hiker
Mar 14th, 2006, 10:46 AM
Ok, so, if it isn't supported, how would you expect it to work? Offhand, I can't think of a single situation where I drag and drop anything on a PDA, and it might be a bit sketchy. Would it be sufficient if you selected an object with one click, then dropped it with another click?

Basically, anything that is not supported requires a bit more thought about the underlying problem. When it comes to drag and drop, I can think of two ways you might get it to work. The first is what I posted above, changing the idea of drag and drop to two kinds of clicks. The second, would be more of a drag and drop, but there are a few issues that I don't know:

1) Does a picturebox control receive click events? If it doesn't, try putting the control ontop of a panel control of the exact same size. The panel does receive click events.

2) Does anything receive mousemove events? If either the picture box or panel controls do, then the problem is relatively trivial. In the click event you would set some variable indicating mousedown (the mouseup and mousedown events are probably too much to ask for, but they would be useful, too). Then in the mousemove event, you would have to figure out what other control the mouse has stopped over, and that's the drop point.

3)However, you'd also have to figure out what event occurs when the mouseup occurs. The drawing and character recognition features of PDA's tells me that these things have to exist in some form, but I have never attempted anything like this, so I am not familiar with them.

AlphaScorpious
Mar 14th, 2006, 12:45 PM
I don't understand why drag and drop wouldn't be supported, but if it isn't, it isn't. MouseDown, MouseUp and MouseMove are all supported for Picture Box and Panel so I guess I'll have to create my own drag and drop procedures.

Shaggy Hiker
Mar 14th, 2006, 08:06 PM
The whys behind some of the decisions regarding the CF are beyond me. This is just another example. Two others that bug the heck out of me are the lack of multi-select listboxes, and colored buttons. However, for everything they leave out, there's generally a way to get around it......with some effort.

petevick
Mar 16th, 2006, 01:34 AM
Hi,
coloured buttons are supported - just not in design mode in VS2003.

Just use the backcolor property in code

Pete

Shaggy Hiker
Mar 16th, 2006, 03:43 PM
Cool....maybe I'll make use of them. Buttons make better checkboxes than checkboxes do in a touchscreen environment.