Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .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 December 5th, 2006, 10:23 AM
Registered User
 
Join Date: Nov 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Bajrang
Default Drag n Drop MenuStrip Item's To form

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag and Drop batott ASP.NET 2.0 Professional 3 April 26th, 2008 07:59 PM
Drag/Drop bmains Javascript 1 September 22nd, 2004 07:29 PM
drag drop outlook email into form Tiffany Beginning VB 6 0 February 5th, 2004 04:33 PM
Drag and drop Clive Astley Access 2 August 15th, 2003 12:11 PM





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