Copy DataSet Component DesignTime Behavior?

I am developing a component that needs to behave like the DataSet component in regards to ...

When the DataSet component is dropped onto a Windows form or UserControl, the developer is prompted to choose a typed DataSet, or to use an untyped DataSet.

When a typed dataset is selected, VStudio then replaces the untyped dataset with the the typed version Type in the declare statement, and instantiate methods in the code for that form/UC.

****
I need to prompt the developer when my custom component is dropped on a form for a more specific type in the same manner as the DataSet component.

I learned quite a bit about type converters and how to control the InitializeComponent code using CodeDom from some great articles.  It seems I am in the right ballpark.

I just need some guidence on how to react to my component being added to the form, prompt the user, replace with a more specific type.

Any where to look and the topics/classes/events/etc... I should be looking for would be greatly appreciated.

Thanks


Answer this question

Copy DataSet Component DesignTime Behavior?

  • Arvan

    I could just use a normal form to prompt users for input, right

    Thanks,
    Alan


  • Knubbi

    I found a solution...

    Create a ToolboxItem class for the component, add the ToolboxItem attribute to the component, override the CreateComponentsCore method on ToolboxItem to return the desired type.

  • Copy DataSet Component DesignTime Behavior?