circular ref. problems.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jesper

    circular ref. problems.

    Hi,

    From my main form I instantiate a usercontrol on a panel.
    How can I invoke functionality in my main form from
    events generated in my usercontrol?

    Is it possible to furnish the usercontrol with an
    eventhandler in my main form?

    Do I have to seperate out the functionality I want to
    invoke from the userctrl, into a seperate dll in order to
    be able reference the functionality.

    brgds Jesper
  • Aravind C

    #2
    Re: circular ref. problems.

    Hi Jesper,

    [Jesper wrote:][color=blue]
    > Do I have to seperate out the functionality I want to
    > invoke from the userctrl, into a seperate dll in order to
    > be able reference the functionality.[/color]

    If your user control will be used from other containers,
    consider keeping the user control in a seperate assembly
    ((ie) not in the same assembly as your current hosting form).

    [Jesper wrote:][color=blue]
    > Is it possible to furnish the usercontrol with an
    > eventhandler in my main form?[/color]

    You can expose the events in your control
    that the containers such as your form will be able to subscribe to.

    myUserControl.M yEvent += new MyDelegateEvent Handler(this.My FormHandler);

    Regards,
    Aravind C



    "Jesper" <anonymous@disc ussions.microso ft.com> wrote in message
    news:0aa201c3a3 76$bf1b6d60$a10 1280a@phx.gbl.. .[color=blue]
    > Hi,
    >
    > From my main form I instantiate a usercontrol on a panel.
    > How can I invoke functionality in my main form from
    > events generated in my usercontrol?
    >
    > Is it possible to furnish the usercontrol with an
    > eventhandler in my main form?
    >
    > Do I have to seperate out the functionality I want to
    > invoke from the userctrl, into a seperate dll in order to
    > be able reference the functionality.
    >
    > brgds Jesper[/color]


    Comment

    Working...