M
MarkR
Hello:
I am trying to build a drag-and-drop operation with a control derived from
my abstract base class. The control is either a PictureControl or a
PictureGroupControl, both of which have PictureComponentControl as their
superclass.
When handling a DragOver event, I'd like to treat the dragged object as a
PictureComponentControl without having to explicity test for whether the
object is a PictureControl OR a PictureGroupControl, but
GetData/GetFormats/GetDataPresent seem to only work with the subclass, not
with the superclass. I've even tried explicitly casting the object when I
begin the DoDragDrop() operation, but even then it doesn't seem to stick.
Any advice for me? I know I could test for both subclasses explicitly, but
that seems like bad OO -- then, in the future when I invent a
SuperPictureControl, I'll have trouble. Is there a better way to do this,
perhaps using Reflection or an Interface?
Thank you,
/m
I am trying to build a drag-and-drop operation with a control derived from
my abstract base class. The control is either a PictureControl or a
PictureGroupControl, both of which have PictureComponentControl as their
superclass.
When handling a DragOver event, I'd like to treat the dragged object as a
PictureComponentControl without having to explicity test for whether the
object is a PictureControl OR a PictureGroupControl, but
GetData/GetFormats/GetDataPresent seem to only work with the subclass, not
with the superclass. I've even tried explicitly casting the object when I
begin the DoDragDrop() operation, but even then it doesn't seem to stick.
Any advice for me? I know I could test for both subclasses explicitly, but
that seems like bad OO -- then, in the future when I invent a
SuperPictureControl, I'll have trouble. Is there a better way to do this,
perhaps using Reflection or an Interface?
Thank you,
/m