M
Michi
Hi
Does anybody know how I can display own icons for drag & drop ?
thx
Does anybody know how I can display own icons for drag & drop ?
thx
Michi said:Does anybody know how I can display own icons for drag & drop ?
Oliver Sturm said:You need to use a few Windows API functions ImageList_DragXXX to do this.
There's a sample that shows how to do this here:
http://www.codeproject.com/cs/miscctrl/TreeViewDragDrop.asp
Michi said:wow. much code for this little thing...
thanks for the link/sample project
Danny said:Does this mean it can't be done with no/low-trust apps like those run via
ClickOnce?![]()
Oliver Sturm said:As soon as you don't have permissions to do interop, you're out of luck.
Danny said:Doh!
I understand that some MS controls (like the treeview) work like this
anyway - is this just a case of "if microsoft wraps it, it doesn't need
interop permission"?
Oliver Sturm said:I don't know exactly what you're seeing with the TreeView, I don't
normally use it
This is .NET 2, so it might have been changed from earlier versions - but
I would think the TreeView couldn't possibly work in an environment where
the UnmanagedCode permission is not granted.
I saw that the TreeView does in fact have this line on its WndProc:
[SecurityPermission(SecurityAction.LinkDemand,
Flags=SecurityPermissionFlag.UnmanagedCode)]
Danny said:That's what I thought, but not for the reason you gave. My original
question is answered on the page you posted, I understand the security a
lot more. However, you said:
I saw that the TreeView does in fact have this line on its WndProc:
[SecurityPermission(SecurityAction.LinkDemand,
Flags=SecurityPermissionFlag.UnmanagedCode)]
Now that confused me. For two reasons... One, I don't understand why it's
needed - surely the treeview is pretty safe?! Two - does this mean my
planned ClickOnce application can't use the TreeView?
Where did you get that info from? Is it based on the beta2 and could it
change? Or was it from msdn?![]()
Oliver Sturm said:But I think you can actually run ClickOnce applications that require all
kinds of permissions client side; what I meant was you'll have to make
sure you have these permissions because the TreeView certainly seems to
require them. To acquire the needed permissions, you'll need to use a
feature called "permission elevation". Here's a blog article with a quick
explanation: http://blogs.msdn.com/shawnfa/archive/2003/11/14/57031.aspx
This information is based on beta 2 and I got it by looking at the sources
for the TreeView with Reflector.