Discussion:
What is the best way to restrict a drop in a designer?
(too old to reply)
tribbles
2007-10-03 21:12:41 UTC
Permalink
I have a designer surface that allows several custom user controls to
be used on it. I have created a new user control which is a container
that needs to only allow a few of the possible controls choices to be
placed in it.

I've experimented with a ParentControlDesigner and found that the
various 'Can...' methods works with paste commands and moving of objects
already on the design surface, but not with an item being dropped from
the Toolbox. I've tried an OnDragEnter to disallow a drop, but again,
it has no effect on toolbox items that are dropped.

How do you get the toolbox drag to recognize that a drop is disallowed?
Richard
2007-12-11 04:08:00 UTC
Permalink
Did you get anything working?
Post by tribbles
I have a designer surface that allows several custom user controls to
be used on it. I have created a new user control which is a container
that needs to only allow a few of the possible controls choices to be
placed in it.
I've experimented with a ParentControlDesigner and found that the
various 'Can...' methods works with paste commands and moving of objects
already on the design surface, but not with an item being dropped from
the Toolbox. I've tried an OnDragEnter to disallow a drop, but again,
it has no effect on toolbox items that are dropped.
How do you get the toolbox drag to recognize that a drop is disallowed?
Loading...