Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2003, 03:11 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Utpal
Default Question about List Box MouseDown event

Hi everybody,

Following is the code of the MouseDown event of a list box:

Code:
    Private Sub ListBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDown
        Dim DragDropResult As DragDropEffects
        If e.Button = MouseButtons.Left Then
            DragDropResult = ListBox1.DoDragDrop(ListBox1.Items(ListBox1.SelectedIndex), _
                            DragDropEffects.Move Or DragDropEffects.Copy)
            ' If operation is a move (and not a copy) then
            ' remove the item from the first list box.
            If DragDropResult = DragDropEffects.Move Then
                ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
            End If
        End If
    End Sub
In the above code, the code within the condition "If DragDropResult = DragDropEffects.Move Then" executes after the mouse button is released, however at that time the rest of the code does not execute. This is the first time I am observing this type of behaviour. How does this happen? Could you explain? Another thing I noticed is that the MouseUp event does not execute. When does it fire?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Grab Values From List Box into Text Box phungleon VB How-To 2 June 19th, 2008 10:33 PM
multi-column list box values moved to 2nd list box sbmvr Access VBA 1 May 14th, 2007 01:58 PM
Search / List Box Question. sprocket Access 2 July 13th, 2006 01:28 PM
Populate List Box by Combo Box Selection mmcdonal Access 2 June 15th, 2004 12:08 PM
Search using drop down list box and a text box tcasp Classic ASP Basics 1 July 31st, 2003 02:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.