Moving code from a main class to a child class
Posted on 2011-03-23
My question seems to be simple but i find it hard to actually explain what i want to do. Everything i know about vb.net is self thought and i feel i skipped the basics.
My current project is becoming unreadable because most of the code is in the main class together with the interface. So i want to move my code to classes.
Let's say i have a main class and a child class.
I moved my subs and functions to the child class and put inherits main at the top, no errors so far.
now i call the functions in the main class like child.function this also works
The problem is now that the code in the child class the controls are not found (text-boxes and such). What i can do now is edit the child class and put main. in front of every textbox and button. This will take alot of time, is there a better way to do this?