I
I_AM_DON_AND_YOU?
This is the scenario:
I have a VB.Net project comprising of a few Forms. On Form1 I have more than
20 buttons. There is a very lenghty code written in click event of each and
every button. Right now I haven't used any sub procedure. I mean to say I am
writing the code directly in the click event. So it's become very lengthy
and therefore to figure out some problem or make any changes I have to
scroll at lot. Also in addition to click event procedures there are may
other events where code is written. It's kind of mess.
My question is would it be good idea if I add 20 Modules and name them
Button1Code, Button2Code etc.etc. and create one procedure in all of them
which will contain the code of Button's click event. Then it would be easier
to quickly find out the code. For example I would know that if I have to
make changes in the click event of Button1 then I have to go to Button1Code
Module (and check the procedure in it), and so on..
Is this a good idea? What are your suggestions.
Thanks in advance!
I have a VB.Net project comprising of a few Forms. On Form1 I have more than
20 buttons. There is a very lenghty code written in click event of each and
every button. Right now I haven't used any sub procedure. I mean to say I am
writing the code directly in the click event. So it's become very lengthy
and therefore to figure out some problem or make any changes I have to
scroll at lot. Also in addition to click event procedures there are may
other events where code is written. It's kind of mess.
My question is would it be good idea if I add 20 Modules and name them
Button1Code, Button2Code etc.etc. and create one procedure in all of them
which will contain the code of Button's click event. Then it would be easier
to quickly find out the code. For example I would know that if I have to
make changes in the click event of Button1 then I have to go to Button1Code
Module (and check the procedure in it), and so on..
Is this a good idea? What are your suggestions.
Thanks in advance!