Click here to Skip to main content
16,005,281 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionPaging a DataList? Pin
rashadaliarshad13-Jul-07 0:34
rashadaliarshad13-Jul-07 0:34 
AnswerRe: Paging a DataList? Pin
Dave Kreskowiak13-Jul-07 3:37
mveDave Kreskowiak13-Jul-07 3:37 
QuestionHow can i update custom document properties... Pin
koolprasad200313-Jul-07 0:01
professionalkoolprasad200313-Jul-07 0:01 
Questionmultiple items dragging and dropping from one list box to another listbox.? Pin
sudhakar7912-Jul-07 23:56
sudhakar7912-Jul-07 23:56 
AnswerRe: multiple items dragging and dropping from one list box to another listbox.? Pin
Dave Kreskowiak13-Jul-07 3:29
mveDave Kreskowiak13-Jul-07 3:29 
GeneralRe: Your logic is not working? Pin
sudhakar7915-Jul-07 19:12
sudhakar7915-Jul-07 19:12 
GeneralRe: Your logic is not working? Pin
Dave Kreskowiak16-Jul-07 2:03
mveDave Kreskowiak16-Jul-07 2:03 
GeneralHere is the code... Pin
sudhakar7916-Jul-07 2:54
sudhakar7916-Jul-07 2:54 
Many many thanks for your interest.
Here is the code where I am passing a string to dodragdrop() function.Please make the needfull changes to this code.


Private Sub ListBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDown

If ListBox1.Items.Count = 0 Then
Return
End If

Dim lsstring As String = ListBox1.Items(ListBox1.IndexFromPoint(e.X, e.Y)).ToString()

Dim lodde1 As DragDropEffects =DoDragDrop(lsstring,DragDropEffects.All)
If lodde1 = DragDropEffects.All Then
ListBox1.Items.RemoveAt(ListBox1.IndexFromPoint(e.X, e.Y))
End If
End Sub



/************** here is the entire code of sample project************///


Public Class Form1

Private Sub ListBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragDrop
If e.Data.GetDataPresent(DataFormats.StringFormat) Then
Dim Lsstr1 As String = DirectCast(e.Data.GetData(DataFormats.StringFormat), String)
ListBox1.Items.Add(Lsstr1)
End If
End Sub

Private Sub ListBox1_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragOver
e.Effect = DragDropEffects.All
End Sub

Private Sub ListBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDown
If ListBox1.Items.Count = 0 Then
Return
End If

Dim lsstring As String = ListBox1.Items(ListBox1.IndexFromPoint(e.X, e.Y)).ToString()
Dim lodde1 As DragDropEffects = DoDragDrop(lsstring, DragDropEffects.All)

If lodde1 = DragDropEffects.All Then
ListBox1.Items.RemoveAt(ListBox1.IndexFromPoint(e.X, e.Y))
End If
End Sub

Private Sub ListBox2_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox2.DragDrop
If e.Data.GetDataPresent(DataFormats.StringFormat) Then
Dim Lsstr1 As String = DirectCast(e.Data.GetData(DataFormats.StringFormat), String)
ListBox2.Items.Add(Lsstr1)
End If
End Sub

Private Sub ListBox2_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox2.DragOver
e.Effect = DragDropEffects.All
End Sub

Private Sub ListBox2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox2.MouseDown
If ListBox2.Items.Count = 0 Then
Return
End If
Dim ls As String = ListBox2.Items(ListBox2.IndexFromPoint(e.X, e.Y)).ToString()
Dim lodde1 As DragDropEffects = DoDragDrop(ls, DragDropEffects.All)
If lodde1 = DragDropEffects.All Then
ListBox2.Items.RemoveAt(ListBox2.IndexFromPoint(e.X, e.Y))
End If
End Sub
End Class


Thanks and Regards,
sudhakar venati,
Mob: 0 984 55 989 71.

GeneralRe: Here is the code... Pin
Dave Kreskowiak16-Jul-07 13:25
mveDave Kreskowiak16-Jul-07 13:25 
Questionwhat is the problem with this code Pin
chiyankrishna12-Jul-07 23:32
chiyankrishna12-Jul-07 23:32 
AnswerRe: what is the problem with this code Pin
Guffa12-Jul-07 23:42
Guffa12-Jul-07 23:42 
GeneralRe: what is the problem with this code Pin
Vasudevan Deepak Kumar13-Jul-07 0:05
Vasudevan Deepak Kumar13-Jul-07 0:05 
AnswerRe: what is the problem with this code Pin
chiyankrishna13-Jul-07 0:31
chiyankrishna13-Jul-07 0:31 
GeneralRe: what is the problem with this code Pin
Dave Kreskowiak13-Jul-07 2:53
mveDave Kreskowiak13-Jul-07 2:53 
AnswerRe: what is the problem with this code Pin
Guffa13-Jul-07 3:18
Guffa13-Jul-07 3:18 
GeneralRe: what is the problem with this code Pin
Dave Kreskowiak13-Jul-07 3:31
mveDave Kreskowiak13-Jul-07 3:31 
AnswerRe: what is the problem with this code Pin
Paul Conrad13-Jul-07 4:32
professionalPaul Conrad13-Jul-07 4:32 
QuestionWhy can't i catch parameter Pin
boyindie12-Jul-07 23:10
boyindie12-Jul-07 23:10 
AnswerRe: Why can't i catch parameter Pin
Guffa12-Jul-07 23:40
Guffa12-Jul-07 23:40 
GeneralRe: Why can't i catch parameter Pin
boyindie12-Jul-07 23:47
boyindie12-Jul-07 23:47 
GeneralRe: Why can't i catch parameter Pin
Dave Kreskowiak13-Jul-07 2:45
mveDave Kreskowiak13-Jul-07 2:45 
GeneralRe: Why can't i catch parameter Pin
boyindie13-Jul-07 2:56
boyindie13-Jul-07 2:56 
GeneralRe: Why can't i catch parameter Pin
boyindie13-Jul-07 3:05
boyindie13-Jul-07 3:05 
GeneralRe: Why can't i catch parameter Pin
Dave Kreskowiak13-Jul-07 5:51
mveDave Kreskowiak13-Jul-07 5:51 
AnswerRe: Why can't i catch parameter Pin
Guffa13-Jul-07 6:03
Guffa13-Jul-07 6:03 

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.