Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DragEventArgs between apps
Message
De
08/06/2010 11:20:14
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
DragEventArgs between apps
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01467922
Message ID:
01467922
Vues:
120
Hi,

I've implemented drag/drop between instances of the same sub-classed TreeView passing a reference to the TreeView itself as the DataObject. So starting the drag I have :
DataObject d = new DataObject(typeof(SWC.TreeView), this);
const DragDropEffects de = DragDropEffects.Copy;
DragDrop.DoDragDrop(this, d, de);
and in OnDrop():
if (e.Data.GetDataPresent(typeof(SWC.TreeView)))
SWC.TreeView t = (SWC.TreeView)e.Data.GetData(typeof(SWC.TreeView));
This works fine between TreeViews within the same instance of the application but when used between instances the GetData() line throws a ComException 'Invalid tymed'.
I *think* this is because COM only supports a fixed number of formats for drag/drop (and obviously my class is not amongst them :-{ )
(http://msdn.microsoft.com/en-us/library/ms691227(VS.85).aspx)

Any suggestions for a workaround?
(This is actually in WPF but AFAIK the DragDrop is the same as in WinForms)
Répondre
Fil
Voir

Click here to load this message in the networking platform