473,394 Members | 1,700 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,394 software developers and data experts.

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

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 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 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 = LinkTree.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
-----------------------------
Nov 20 '05 #1
0 11639

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

Similar topics

42
by: Steven O. | last post by:
I am seeking some kind of tool that I can use for GUI prototyping. I know how to use Visual Basic, but since a lot of software is being coded in Java or C++, I'd like to learn a Java or C++ -based...
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
1
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...
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.