473,324 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Do drag n drop in VB.Net in fifteen lines of code - (too easy)

- hehe - When you're explaining every angle of a socio economic scenario in
the context of a review of current technical issues it can take a little
time to get it right - slibS, slibW, slibD (so let it be Written, so let it
be Said, so let it be Done)

I was searching through the MSDN documentation trying to figure out how to
do drag n drop and I found a sample program. The sample program did all
sorts of fancy junk like dynamically create it's user controls etc. (pomp -
is it really necessary to be so gaudy when trying to explain a simple
point?) So, realizing the state of the economy and the period of history in
which I was so unfortunately born, I spent the next 3 or so hours weeding
through the affectatious displays of bravado and uselessly flagrant
manefestations of excess (blank lines every where in the sample code - What
does "CONCISE" mean?)

When a people are showing a near complete, generally applicable, state of
chaotic ineptitude something is wrong with the system, though it may look
fine on the outside. Which is why we have UCOM www.UCOM-ISM.com
<http://www.UCOM-ISM.com> shedding
light on the source of and solution for these obvious yet completely
overlooked social problems.

Anyway; I eventually was able to find the actual code that was necessary to
do drag n drop in VB.NET:

There was 500 lines of code in the sample using a ListBox control!
I was able to do drag n drop in a TreeView control with 15 lines of code?

'---------------------------------------------------------------------------
Protected Sub TreeView1_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseMove
Dim sNodePathStr As String
sNodePathStr = LinkTree.SelectedNode.FullPath()
Dim dropEffect As DragDropEffects = TreeView1.DoDragDrop(sNodePathStr,
DragDropEffects.Copy)
End Sub
Private Sub TreeView1_DragOver(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles TreeView1.DragOver
e.Effect = DragDropEffects.Copy
End Sub
Private Sub TreeView1_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles TreeView1.DragDrop
Dim oNode As TreeNode
Dim oDroppedNodePath As Object =
CType(e.Data.GetData(GetType(System.String)), System.Object)
Debug.WriteLine("Selected Item: " & CType(oDroppedNodePath, String))
oNode = TreeView1.GetNodeAt(e.X, e.Y)
Debug.WriteLine("Drop Site: " & oNode.FullPath)
End Class
'---------------------------------------------------------------------------

--
-----------------------------
Name: James Allen Bressem
Phone: (323) 691-4279
Email: 18*****@SprintMail.Com
UCOM: http://www.ucom-ism.com
Mirror site: http://www.geocities.com/wizardofwizards
-----------------------------
Jul 21 '05 #1
1 1743
James - at least have the decency to cross-post
so that we can all jump on you together.
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sean McIlroy | last post by:
The subject line essentially says it all. Is there a way to do it? If so, where do I look to find out how? Any help will be much appreciated. Thx, STM
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
4
by: kemal asad | last post by:
how can i create a vb application where i can drag and drop ( with a move caracteristic) email from outlook, into my application( email viewer). thanks, any help is welcome, samples a great way of...
6
by: James Allen Bressem | last post by:
I was searching through the MSDN documentation trying to figure out how to do drag n drop and I found a sample program. The sample program did all sorts of fancy junk like dynamically create it's...
0
by: James Allen Bressem | last post by:
Do drag n drop in VB.Net in ten lines of code - (too easy) I was searching through the MSDN documentation trying to figure out how to do drag n drop and I found a sample program. The sample...
2
by: James Allen Bressem | last post by:
- hehe - When you're explaining every angle of a socio economic scenario in the context of a review of current technical issues it can take a little time to get it right - slibS, slibW, slibD (so...
17
by: Romulo NF | last post by:
I´ve seen some people around the web wondering about a code to reorder table columns using the mouse (drag and drop). Since i had already made one script to reorder table lines (TR´s) i decided to...
0
by: Romulo NF | last post by:
I´ve recently posted a script to move columns from a table using drag and drop javascript. Recently i´ve received a message of a user of this communty showing interest in the script to move lines...
2
by: weird0 | last post by:
i am developing an application in which i can drag and drop icons using c#. I tried out a few tutorials on code-project.com, but they don't seem to work and are too hard to understand, like the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.