locked
Create Code for Handler/delegate of control RRS feed

  • Question

  • Hi,

     

    I have created component which has delegate for customization of his calculations.

    I want user should be able to set this handler by using "Property Browser".

    For this purpose I created one property which is has type string.

     

    I will like to get help for what I need to do to achieve,

    "User set this property and Designer/CodeDom should create correct signature method in the

    forms code."

     

    thanks

    manoj

     

    Friday, May 11, 2007 12:47 AM

Answers

  • The only I know that you can get Visual Studio 2005 to automatically create an event handler is to define the [DefaultEvent("MyEvent")] attribute on your class. Then when you double click the control it will automatically create the handler and hook into the defined "MyEvent". So add an event and set its name in the DefaultEvent attribute.

    Phil Wright
    Free user controls for .NET Windows.Form
    http://www.componentfactory.com
    Sunday, May 13, 2007 11:41 AM