Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / December 2004

Tip: Looking for answers? Try searching our database.

dragdrop between two listbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ziv - 23 Sep 2004 08:24 GMT
Hi
i want dragdrop option item between two listbox.
when fire onmousedown to dragdrop,listbox's selectedIndex is old.
beacuse onchange event after onmousedown event.
i also try componentFromPoint to get option,but didn't locate option.
does any one know how to get new Index in mousedown event or good idea to do
this ?

----------
by ziv
stuart@nexusnet.co.nz - 21 Oct 2004 02:35 GMT
I too am trying to do the same thing. I can drag the whole Select box but not the options[selectedIndex].value as it is still holding the previous value. I just wondered if you had found a solution to this problem?
sshimla - 09 Dec 2004 13:56 GMT
Hi Ziv, Ma Hamatzav? and Hi Stuart...

Drag and drop in DHTML is all about deception...
You need to show AS IF you are dragging from the list box where in
fact you are capturing the mousedown event and hover (with a DIV to
show the selectedIndex value next to your mouse - this will look
better)
And onmousemove plant the value in the other list box.

To make it neater you can also try to calculate over which value of
the 2nd list box you are standing and adding it straight after it (to
make it seem more real).

Just remember, list boxes and dropdowns always zIndex over any
floating DIVs so the nice hovering DIV might not appear over them,
better position it to the bottom right corner of the mouse cursor so
at least it will appear just before the "drop" (onmouseup)

Be sure to use SetCapture and ReleaseCapture... read about them some
more in MSDN or something.

I have some code samples I've written of magnificant drags&drops
in DHTML (for example, an IE version of the Windows Solitaire game),
I don't want to send them yet as they are painfully complicated to
understand straight off...
Try this or let me know if something is not clear and lets take it
from there...

All the best!

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.