MarkupLabel Drag & Drop List Sample & Questions |
Post Reply |
Author | |
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
Posted: 17 March 2009 at 1:20pm |
I'm posting this here for 2 reasons:
1) I'm not sure anyone ever looks at the Markup board :) 2) I'll be running a bug/question list based on the results of this continuing experiment. First, I'll describe my requirements: 1) Create a list of attachments (with markup support) that supports OLE Drag & Drop from Windows Explorer 2) Allow the list of attachments to be reorganized via internal drag & drop 3) Dragging outside of the visible area of the list should automatically scroll the list items if required. An example of what an attachment list item might look like is: Originally, I had hoped to use the ReportControl for this task since it supports markup and OLE Drag & Drop (with a nice insert point marker). Unfortunately, the markup support is only aesthetic, as UI items are non-interactive. So instead, I've attempted to use the MarkupLabel control to achieve these goals, but I've encountered some other limitations: 1) The MarkupLabel has no OLE Drag & Drop support. 2) There doesn't seem to be a way to tell when MouseUp has occurred outside of the control area. 3) I haven't figured out a way to track when the mouse has left the control area to automatically scroll up and down the list while dragging. I imagine subclassing could fix #1, and a timer with mouse position checking could likely fix #2 & #3, but these are ugly solutions. Nicer would be: 1) CJ could add the standard OLE Drag & Drop events to the MarkupLabel. 2) The LostMouseCaptureEvent could fire when the mouse button has been released outside of the object that the mouse button was originally depressed over. But maybe I am misunderstanding the purpose of this event? Here's a demo of what I have got working so far: uploads/20090317_131915_XamlAttachments.zip There are some known limitations & bugs: 1) While dragging, if the mouse button is released over the insertion point, the item won't be dropped and the drag operation will get stuck until a text item is clicked. 2) While dragging, if the mouse is released outside of the control area, the item won't be dropped and the drag operation will get stuck until a text item is clicked. 3) There is no auto-scroll when dragging items. Anyone have any good ideas on how to achieve this? 4) The "attachment" items are just TextBlocks right now, but it should be easy enough to add nicer looking markup items (as in my screenshot) 5) The code uses an ugly naming/id system that requires string handling. I will be updating this to use a class system in the Tag property I think... Anyway, feedback and ideas are welcome, and I'll post updates as they are available. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |