Dynamic event handler

  • Thread starter Thread starter Nayan
  • Start date Start date
N

Nayan

I am creating new child forms in MDI app.

I want different (behaviour) event handlers of paint event to be
created for each child form. Each child has different handler.

Any idea if it can be done easily at run time?
 
Hi,

It's not clear what you want.

In an MDI application each child is a distinct Form, which of course has its
own OnPaint method that you can override. If you want to provide different
implementations for any particular Form you can create a base class to
encapsulate the operation, with a method such as Paint, for example, and
then derive as many implementations as you'd like.

If you're trying to allow each child Form to paint their common MDI parent
Form then I'm not sure how that'll work. Which event handler should be
executed when multiple Forms are opened simultaneously (the point of using
MDI to begin with)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top