troubleshooting Question

VB.NET - Class and form working together

Avatar of Wil999
Wil999Flag for Netherlands asked on
Visual Basic.NET
4 Comments1 Solution43 ViewsLast Modified:

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.

Senior Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 4 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 4 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004