View Single Post
Old June 8th, 2005, 08:23 AM
cliffd64 cliffd64 is offline
Authorized User
Join Date: May 2005
Location: Berlin, CT, USA.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default General Scoping Question

Hi all:

I have a general question concerning scoping of code within an application.

I have written an application that consists of a main (parent) form with a toolbar that shows several additional (child) forms based on the value selected on the toolbar.

I have noticed that each of the child forms share identical or nearly identical event handlers like the form load handler, the form close handler, and various common button click event handlers (for exporting to excel, or printing, or initiating a database query etc).

Is there a way to place/define this common code so that it is not replicated amongst each of the forms?

It would be great if these common elements could be defined once in the overall project and not have to be in each form.

Thanks in advance for any suggestions.