Results 1 to 7 of 7

Thread: Drag and Drop

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    74

    Drag and Drop

    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.

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Drag and Drop

    Hi,
    drag and drop is not supported in CF

    Sorry

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Drag and Drop

    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.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    74

    Re: Drag and Drop

    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.

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Drag and Drop

    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.
    My usual boring signature: Nothing

  6. #6
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Drag and Drop

    Hi,
    coloured buttons are supported - just not in design mode in VS2003.

    Just use the backcolor property in code

    Pete

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Drag and Drop

    Cool....maybe I'll make use of them. Buttons make better checkboxes than checkboxes do in a touchscreen environment.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width