PDA

View Full Version : Dragdrop file from explorer to dotnet control in max rollout


lo
04-10-2011, 12:20 PM
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

denisT
04-10-2011, 05:47 PM
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

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: %\n" files
s.text = getfilenamefile files[1]
)
on rol open do tx.AllowDrop = on
)
createdialog rol 200 30

lo
04-10-2011, 06:55 PM
Doh!!!

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

CGTalk Moderation
04-10-2011, 06:55 PM
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.