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 September 1st, 2004, 08:46 AM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default drag and drop to multiple text boxes

I'm a bit stumped here.
I am trying to doing some mapping by taking information from a list view and dragdrop the text information into a text box. The user is able to drop the information into a variety of text boxes depending on a selection that has been previously made. All the examples I have seen deal with single txtbox examples. So.....

1. Can I use a single subroutine to handle the dragdrop for multiple txtboxes?

2. If 1. is true do I need to determine the position of the mouse and then see what txtbox I am trying to drop information into or is there a way that this is automatically done?

Guy
__________________
Guy
 
Old September 2nd, 2004, 11:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Do you want the same information in multiple textboxes or different information in each one?

J
 
Old September 2nd, 2004, 12:31 PM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Different information in each one.

This also means having to know what text box that the mouse is dropping into.

Guy

Guy
 
Old September 2nd, 2004, 03:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Answers:

1. Yes, you just add the textbox(s) to the event handler using the Handles keyword.
----------------------------------------------------------
Private Sub TextBox_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TextBox1.DragDrop, TextBox2.DragDrop

  'add your code here

End Sub
----------------------------------------------------------
2. As shown above, "sender" is the textbox that receives the DragDrop, so you can use this.

J
 
Old September 3rd, 2004, 08:57 AM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks J!:)

This stopped me from doing some really wacky code. Goes to show that I have more yet to learn about vb.Net:)

Guy
 
Old September 6th, 2004, 09:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Glad I could help.

J





Similar Threads
Thread Thread Starter Forum Replies Last Post
drag and drop multiple controls at runtime ramakishore VB How-To 5 November 2nd, 2006 12:56 PM
Please Help me with Drag-n-Drop of multiple items vb_programmer Pro VB 6 9 October 7th, 2006 01:56 AM
Auto-Filling a Text box based on Multiple Boxes zuldan23 Access VBA 1 May 5th, 2006 10:17 AM
Multiple records to be put in text boxes Moumou Classic ASP Databases 3 September 3rd, 2004 06:33 PM





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