Dragdrop file from explorer to dotnet control in max rollout


#1

Has anyone ever gotten this to work?
I know how to do dotnet dragdrop events but it seems with file data max just takes over and only allows max/texture/script files to be dropped. The dotnet events are never fired :shrug:

I tried disabling the global dragdrop max interface but to no avail.

edit: max2009 64bit


#2

where was the problem?


try(destroydialog rol) catch()
rollout rol "DragDrop File"
(
	dotnetcontrol tx "TextBox" width:190 pos:[4,4]
	on tx DragOver s e do
	(
		e.Effect = if e.data.ContainsFileDropList() then e.Effect.Move else e.Effect.None
	)
	on tx DragDrop s e do if e.data.ContainsFileDropList() do
	(
		data = e.data.GetFileDropList()
		files =  for k=0 to data.count-1 collect data.item[k]
		format "files: %
" files
		s.text = getfilenamefile files[1]
	)
	on rol open do tx.AllowDrop = on
)
createdialog rol 200 30


#3

Doh!!!

The problem was me being stupid and forgetting to set .AllowDrop to true.
Denis saves the day again. :beer:


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.