Hi,
I have a class called ParameterSelection, and a form called frmParameterSelection with a bunch of controls which are needed for the user to make a selection.
What is the best way to let the class work with, and react to the control events on the form?
Should i declare an instance of the class in the form_load event? Or should i declare an instance of the form in the class? I want to have as little code as possible in the form.
When i declare an instance of the form in my class, i can only react on the form events. (not on the form controls events) I don't think it is very pretty to declare each form control (withevents) in the class and pass them in in the constructor.
Hopefully someone has a clear way to do this.
Thanks.
The forms controls use their events to manipulate that property.
But the concrete implementation depends on the form type and usage. Is it a modal or non-modal form? How should it be used in your application?
These requirements control whether you need to use constructor injection, where you pass a ParameterSelection instance into the dialog or you use a public property to do so.
When you can post a concise and complete example (attached as zip), then it is easy to demonstrate..