Click here to Skip to main content
15,917,731 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: What is Wrong with the Following Function Pin
Rupesh Kumar Swami23-Jan-08 21:33
Rupesh Kumar Swami23-Jan-08 21:33 
GeneralRe: What is Wrong with the Following Function Pin
Vimalsoft(Pty) Ltd23-Jan-08 22:50
professionalVimalsoft(Pty) Ltd23-Jan-08 22:50 
AnswerRe: What is Wrong with the Following Function Pin
Steven J Jowett23-Jan-08 22:11
Steven J Jowett23-Jan-08 22:11 
GeneralRe: What is Wrong with the Following Function Pin
Vimalsoft(Pty) Ltd23-Jan-08 23:11
professionalVimalsoft(Pty) Ltd23-Jan-08 23:11 
GeneralUserControl Not part of form Pin
plural23-Jan-08 20:25
plural23-Jan-08 20:25 
GeneralRe: UserControl Not part of form Pin
plural23-Jan-08 20:26
plural23-Jan-08 20:26 
Generaldrag and drop in two listbox Pin
sumit703423-Jan-08 19:12
sumit703423-Jan-08 19:12 
GeneralRe: drag and drop in two listbox Pin
C1AllenS25-Jan-08 0:17
C1AllenS25-Jan-08 0:17 
Hello,

You can try out this code. I have used two Listboxes on a form.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        Dim i As Integer<br />
<br />
        For i = 0 To 19<br />
<br />
            Me.ListBox1.Items.Add("Item " & (i + 1).ToString)<br />
<br />
        Next<br />
<br />
    End Sub<br />
<br />
<br />
    Private Sub ListBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDown<br />
<br />
        Try<br />
<br />
            ListBox1.DoDragDrop(ListBox1.SelectedItem, DragDropEffects.Copy)<br />
<br />
        Catch ex As Exception<br />
<br />
            MsgBox("Drag Error: " & ex.Message)<br />
<br />
        End Try<br />
<br />
    End Sub<br />
<br />
<br />
<br />
    Private Sub ListBox2_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox2.DragDrop<br />
<br />
        ListBox2.Items.Add(e.Data.GetData(DataFormats.Text))<br />
<br />
    End Sub<br />
<br />
<br />
<br />
    Private Sub ListBox2_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox2.DragEnter<br />
     <br />
        If e.Data.GetDataPresent(DataFormats.Text) Then<br />
<br />
            e.Effect = DragDropEffects.Copy<br />
<br />
        Else<br />
<br />
            MessageBox.Show("No Text Present")<br />
            e.Effect = DragDropEffects.None<br />
<br />
        End If<br />
End Sub


I believe this should assist you.

Regards,
Allen

Allen Smith

Software Engineer
ComponentOne LLC
www.componentone.com

GeneralRe: drag and drop in two listbox Pin
sumit703422-Oct-08 22:48
sumit703422-Oct-08 22:48 
GeneralTo get focus on textbox Pin
sumit703423-Jan-08 18:07
sumit703423-Jan-08 18:07 
GeneralRe: To get focus on textbox Pin
Paul Conrad23-Jan-08 18:13
professionalPaul Conrad23-Jan-08 18:13 
GeneralRe: To get focus on textbox Pin
sumit703423-Jan-08 18:24
sumit703423-Jan-08 18:24 
GeneralRe: To get focus on textbox Pin
Paul Conrad23-Jan-08 18:42
professionalPaul Conrad23-Jan-08 18:42 
GeneralRe: To get focus on textbox Pin
sumit703423-Jan-08 18:57
sumit703423-Jan-08 18:57 
GeneralRe: To get focus on textbox Pin
Vimalsoft(Pty) Ltd24-Jan-08 1:57
professionalVimalsoft(Pty) Ltd24-Jan-08 1:57 
GeneralRe: To get focus on textbox Pin
Johan Hakkesteegt25-Jan-08 2:35
Johan Hakkesteegt25-Jan-08 2:35 
GeneralCapturing stdout and stderr when running a subcommand (WSH) Pin
orev23-Jan-08 11:52
orev23-Jan-08 11:52 
Generalthree level datagrid drill down Pin
uglyeyes23-Jan-08 10:59
uglyeyes23-Jan-08 10:59 
QuestionPossible to know when copy or paste is done? Pin
abbabbabba23-Jan-08 7:02
abbabbabba23-Jan-08 7:02 
Generalcommunication state Pin
Agbaria Ahmad23-Jan-08 6:31
Agbaria Ahmad23-Jan-08 6:31 
QuestionRichTextBox find and replace Pin
Steven J Jowett23-Jan-08 6:12
Steven J Jowett23-Jan-08 6:12 
AnswerRe: RichTextBox find and replace Pin
Steven J Jowett24-Jan-08 1:57
Steven J Jowett24-Jan-08 1:57 
GeneralConnecting to remote data Pin
dptalt23-Jan-08 5:35
dptalt23-Jan-08 5:35 
GeneralRe: Connecting to remote data Pin
Justin Perez23-Jan-08 5:45
Justin Perez23-Jan-08 5:45 
Questionsetup wizard Pin
Agbaria Ahmad23-Jan-08 3:25
Agbaria Ahmad23-Jan-08 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.