View Single Post
 
Old June 9th, 2005, 06:37 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

Quote:
quote:Originally posted by katsarosj
 Every instance of a standard windows form is going to contain the same event handlers.

If the forms are so similar that you would use the same code in the event handlers for each of them, why don't you just use one form for everything and perform actions based upon what the user selects?

If this isn't what you want, you probably want to develop classes to utilize common methods and properties for your application (or to be used among multiple applications).

J
The forms themselves are not identical, it's just certain controls and certain event handlers end up the same. For example, on each form, there is a submit button to submit a query, a print button to print the datagrid, and a button to export the dataset to excel. The load and closing handlers for the forms are all identical.

In addition, each form has additional specific controls that are unique to that form. I guess the approach I could take is to make a generic form with all the common controls, and have each subsequent specific form use that generic query form as a base to inherit all the common properties. Perhaps I will give that a whirl.