Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
Facing a problem in handling the events of a user control and form
posted

Hi

I am facing a problem in handling the events of a user control and form

I have a created a user control and included that user control in a window form which is opening as a dialog

Now When I am creating the object of window form, the constructor of window form is called which is creating the object of user control. Problem here is that while creating the object of user control, the load method of the user control is called (which I don't know wy=hy)

I think the load of user control should be called only when load of parent form is called

Only difference in using the user control is that it is made public. But I don't think that should create any problem

Thanks
Narinder

  • 469350
    Suggested Answer
    Offline posted

    Hi Narinder,

    This sounds like a general question about programming in DotNet. How is this related to AppStylist or Infragistics?

    You might be better off posting on a more general DotNet programming forum, but I suspect the behavior you are seeing here is correct and that the Load event of the UseControl fires when the control is created, not when the form it is on is shown.