HighTechTalks DotNet Forums  

Custom Designer with Custom Control Issue

Dotnet Framework (WinForms DesignTime) microsoft.public.dotnet.framework.windowsforms.designtime


Discuss Custom Designer with Custom Control Issue in the Dotnet Framework (WinForms DesignTime) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Greg Robinson
 
Posts: n/a

Default Custom Designer with Custom Control Issue - 04-07-2005 , 09:27 AM






In my application I have a base control class - call it BaseControl - from
which I inherit to create multiple controls. I'm using a custom
ControlDesigner class because I need one or two special actions to be
available to the inherited controls at design-time.

But when I create a new control - call it MyControl - by inheriting
BaseControl, and open MyControl in the VS designer, I don't see any evidence
that my custom ControlDesigner class is being used at all; and a quick
MessageBox-in-constructor test verifies that one isn't even being created.

However, if I add BaseControl to the IDE toolbox and drag one onto a Form
without inheriting, all works fine and it uses the custom ControlDesigner,
verifying that it's implemented correctly.

Has anybody run across the same problem? I'm wondering if there's a simple
step I've overlooked that will get VS to use my custom ControlDesigner for
inherited classes; or do I need to go back to the drawing board and find a
way to do what I need to do without having to inherit BaseControl? (Or is
this a glitch? The Framework docs state plainly that all "design-time
attributes" of a Component class should be picked up by its inheritors.)



Reply With Quote
  #2  
Old   
joeycalisay
 
Posts: n/a

Default Re: Custom Designer with Custom Control Issue - 04-07-2005 , 08:30 PM






are they all on the same assembly?

--
Joey Calisay
http://spaces.msn.com/members/joeycalisay/


"Greg Robinson" <greg (AT) cds-am (DOT) net> wrote

Quote:
In my application I have a base control class - call it BaseControl - from
which I inherit to create multiple controls. I'm using a custom
ControlDesigner class because I need one or two special actions to be
available to the inherited controls at design-time.

But when I create a new control - call it MyControl - by inheriting
BaseControl, and open MyControl in the VS designer, I don't see any
evidence
that my custom ControlDesigner class is being used at all; and a quick
MessageBox-in-constructor test verifies that one isn't even being created.

However, if I add BaseControl to the IDE toolbox and drag one onto a Form
without inheriting, all works fine and it uses the custom ControlDesigner,
verifying that it's implemented correctly.

Has anybody run across the same problem? I'm wondering if there's a simple
step I've overlooked that will get VS to use my custom ControlDesigner for
inherited classes; or do I need to go back to the drawing board and find a
way to do what I need to do without having to inherit BaseControl? (Or is
this a glitch? The Framework docs state plainly that all "design-time
attributes" of a Component class should be picked up by its inheritors.)





Reply With Quote
  #3  
Old   
Robin Sanner
 
Posts: n/a

Default Re: Custom Designer with Custom Control Issue - 04-08-2005 , 03:16 PM



I had the same problem in post "Repost for Microsoft: Designer not activated
when designing Inheri", here's the response I received:

Your custom designer will not be used when your custom usercontrol is being
designed. VS uses IRootDesigners when design view is being uses, and using
reflector I can only see FormDocumentDesigner (used by forms) and the
UserControlDocumentDesigner (used by usercontrols).

--
Joey Calisay
http://spaces.msn.com/members/joeycalisay/
"Greg Robinson" <greg (AT) cds-am (DOT) net> wrote


Quote:
In my application I have a base control class - call it BaseControl - from
which I inherit to create multiple controls. I'm using a custom
ControlDesigner class because I need one or two special actions to be
available to the inherited controls at design-time.

But when I create a new control - call it MyControl - by inheriting
BaseControl, and open MyControl in the VS designer, I don't see any
evidence that my custom ControlDesigner class is being used at all; and a
quick MessageBox-in-constructor test verifies that one isn't even being
created.

However, if I add BaseControl to the IDE toolbox and drag one onto a Form
without inheriting, all works fine and it uses the custom ControlDesigner,
verifying that it's implemented correctly.

Has anybody run across the same problem? I'm wondering if there's a simple
step I've overlooked that will get VS to use my custom ControlDesigner for
inherited classes; or do I need to go back to the drawing board and find a
way to do what I need to do without having to inherit BaseControl? (Or is
this a glitch? The Framework docs state plainly that all "design-time
attributes" of a Component class should be picked up by its inheritors.)





Reply With Quote
  #4  
Old   
Michael Powell
 
Posts: n/a

Default Re: Custom Designer with Custom Control Issue - 05-30-2005 , 10:55 AM



I just did a test, and derived classes use my designer without any problem.
My class is derived from ContainerControl, and my designer is derived from
ParentControlDesigner

--
~Mike Powell,
software designer for Ramuseco ltd
www.ramuseco.com

"Greg Robinson" <greg (AT) cds-am (DOT) net> wrote

Quote:
In my application I have a base control class - call it BaseControl - from
which I inherit to create multiple controls. I'm using a custom
ControlDesigner class because I need one or two special actions to be
available to the inherited controls at design-time.

But when I create a new control - call it MyControl - by inheriting
BaseControl, and open MyControl in the VS designer, I don't see any
evidence that my custom ControlDesigner class is being used at all; and a
quick MessageBox-in-constructor test verifies that one isn't even being
created.

However, if I add BaseControl to the IDE toolbox and drag one onto a Form
without inheriting, all works fine and it uses the custom ControlDesigner,
verifying that it's implemented correctly.

Has anybody run across the same problem? I'm wondering if there's a simple
step I've overlooked that will get VS to use my custom ControlDesigner for
inherited classes; or do I need to go back to the drawing board and find a
way to do what I need to do without having to inherit BaseControl? (Or is
this a glitch? The Framework docs state plainly that all "design-time
attributes" of a Component class should be picked up by its inheritors.)





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.