Results 1 to 3 of 3

Thread: Drag drop from textbox to textbox

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Drag drop from textbox to textbox

    I made search before asking this question...

    I have two listboxes... where I can select multiple rows at one time. Now I want to be able to move data to and from them. And if the user selects multiple items I want to be able to drag them all at one time.

    Please point me to some articles I can read, or give me some basic explanations! I tried google for this, but came up with very little... also looked at 101 samples at msdn.


    Oh, I also want the user to be able to insert them at a specific index. I think I have solved how to do that, BUT i want to give the user a graphical hint on which row the items will be dropped at... how is that possible? All I need is a line that changes when i move the mouse (with data) over the target rows, inidicating between rows 4 and 5 etc...


    Anyone???

    /Henrik

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Drag drop from textbox to textbox

    Quote Originally Posted by MrNorth
    I made search before asking this question...

    I have two listboxes... where I can select multiple rows at one time. Now I want to be able to move data to and from them. And if the user selects multiple items I want to be able to drag them all at one time.

    Please point me to some articles I can read, or give me some basic explanations! I tried google for this, but came up with very little... also looked at 101 samples at msdn.


    Oh, I also want the user to be able to insert them at a specific index. I think I have solved how to do that, BUT i want to give the user a graphical hint on which row the items will be dropped at... how is that possible? All I need is a line that changes when i move the mouse (with data) over the target rows, inidicating between rows 4 and 5 etc...


    Anyone???

    /Henrik

    well sounds like you are looking for a few things... i would advise maybe creating a custom control.

    I am not sure if you have created one yet.. if not, then don't worry its pretty much a breeze with .net

    you can create a new class, and inherit from the listbox class... then your class will be everything a listbox is, plus whatever you add to it.

    this way you can code behind the scenes for when a mouseover occurs, to draw the line you want.. and once you get this all working, you can just use that control in all the spots in your app where you want this functionality. I am too busy to just code it all out.. but if you start to work on this (even if you opt out of doing it as a control, and want to just code it in the form) post the code when you get stuck, and I will try to help out to fix the code

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Re: Drag drop from textbox to textbox

    Hi!

    I think inheriting a listbox is a good idea! I have done that in the past when i needed to change a datagrid and shadow some methods. The problem is GDI+ i think, I have done ZERO GDI+ programming But I guess to draw a line is not that complicated


    I will start the work, the only problem i have now is to handle multiple selections...

    /Henrik

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