Drag and Drop an item outside Main window
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Drag and Drop an item outside Main window

  1. #1
    Join Date
    Jun 2009
    Posts
    6

    Drag and Drop an item outside Main window

    How can i drag an item (list item) from its list and drop it outside the window and still handle the event?

    Example: If i have a list controls which contains a list of filenames, then i drag 1 list item outside the main window and drop it, a message box is displayed which displays the filename.

    I am planning to develop similar application which performs additional processes when an item is draged(and droped) outside the main window.

    Please help.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,202

    Re: Drag and Drop an item outside Main window

    As long as you are performing drag drop operations within your application, you will be okay (i.e it shouldn't matter if the source/target is in a secondary window).

    http://bea.stollnitz.com/blog/?s=Dra...&submit=Search

  3. #3
    Join Date
    Jun 2009
    Posts
    6

    Re: Drag and Drop an item outside Main window

    Quote Originally Posted by Arjay View Post
    As long as you are performing drag drop operations within your application, you will be okay (i.e it shouldn't matter if the source/target is in a secondary window).

    http://bea.stollnitz.com/blog/?s=Dra...&submit=Search
    Thats the problem, the drop target is outside of the application example; Desktop or another window.
    This feature can be found in EmEditor (http://www.emeditor.com/) wherein you can drag a tab item outside the window and another instance of the application opens.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,202

    Re: Drag and Drop an item outside Main window

    Quote Originally Posted by cebugdev View Post
    Thats the problem, the drop target is outside of the application example; Desktop or another window.
    This feature can be found in EmEditor (http://www.emeditor.com/) wherein you can drag a tab item outside the window and another instance of the application opens.
    I'm not familiar with the EmEditor, nor do I see the functionality you are referring to on its website.

    Can you describe the functionality you desire in detail (i.e the type of object you wish to drag, the drop target, what the expected result is)?

    Dragging a tab off an application and dropping it onto the window of another application to open an instance of the first application doesn't make a whole lot of sense to me. I can't see the benefit of doing this - please help me understand.

    If I can understand this, I might be able to suggest an approach.

  5. #5
    Join Date
    Jun 2009
    Posts
    6

    Re: Drag and Drop an item outside Main window

    heres how EmEditor drag and drop works;
    When you open a file it is displayed in a tab item similar to firefox and/or IE.
    when you drag a tab item(the file) outside of the main window(the application)
    a new instance of the Editor open which contains the file(represented in the tab).

    If IE has this features it will work like this;
    Web pages are arranged per tab, when you drag the tab item outside the main window
    it will open a new instance of IE for the webpage dragged.

    Hope you guys get the idea.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,202

    Re: Drag and Drop an item outside Main window

    Okay what wasn't necessarily clear was that if the tabs were being dropped on other specific applications.

    Normally when you drag, as you move the mouse around, you identify drop targets.

    In your case, all you need to identify is when the window or object you are over isn't a window or object in your application. If the user releases the mouse button outside the main window, you just pass a command line parameter of the file path to the Process class and start up your application.

    Presumably each tab is going to be bound to some data that contains the full path to the file. So that when the mouse is released the path can be passed to a new instance of the app.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center