[VBA] Drag&Drop target in Userform

skorpionkz

Well-known Member
Joined
Oct 1, 2013
Messages
1,171
Office Version
  1. 2016
Hi All,

I am developing new functionality to the VBA application I have and I want to try to use Drag&Drop functionality.
For simplicity, I have 2 user forms. First contains ListView (MSComctlLib.ListView) with items for user to select. I am trying to use myListView_OLEDragDrop to drag data from this list to another user form TextBox and/or ComboBox.
Problem for me is that the text and combo boxes are dynamically created by VBA and I can't find the way to identify "target" field, where I am dropping value.

Any idea?

Thank you,
Andrzej
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
You could use the WithEevnts keyword to hook the BeforeDragOver and BeforeDropOrPaste events of the dynamically created textbox and combobox .
 
Upvote 0
You could use the WithEevnts keyword to hook the BeforeDragOver and BeforeDropOrPaste events of the dynamically created textbox and combobox .
I was looking at it, but I couldn't find any way to identify target field (I mean where I am dropping value) :( I probably missing something obvious.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,849
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top