![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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.) |
#3
| |||
| |||
|
|
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.) |
#4
| |||
| |||
|
|
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.) |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |