Hi All
I M using
VB.NET 2005
I want to drag and drop a menuStrip's Item to form( As well as its functionality)
I don't want to place a control on which other control can be draged, I want to drop any MenuStrip Item to my form.
I set AllowDrop property of my form to true.
what should i do ( I underlined that code)
NewToolStripMenuItem.Text or just NewToolStripMenuItem
Because I want to add this Item to my form not its text
Private Sub NewToolStripMenuItem_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NewToolStripMenuItem.MouseDown
NewToolStripMenuItem.DoDragDrop(NewToolStripMenuIt em.Text, DragDropEffects.Copy)
End Sub
Private Sub me_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragEnter
' If (e.Data.GetDataPresent(GetType(System.String))) Then
e.Effect = DragDropEffects.Copy ' Give OK feedback
'End If
End Sub
Private Sub me_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
' WHAT CODE SHOULD I WRITE TO ADD IT TO FORM
End Sub
Last thing that what should i use in DragDrop event.
like ( mybtn=e.Data.GetData(DataFormats.Text) ) what format i should use
Because it uses text,files, images only for fprmat.
what is correct way to get that MenuItem here at runtime ( It shouldnot dependent on MenuItem's type Because User can drag/drop different types of MenuItems)
Waiting for ur reply
Bajrang