Form size - in terms of code

  • Thread starter Thread starter Woody Splawn
  • Start date Start date
W

Woody Splawn

I don't mean to be too wordy but if you will indulge me a moment I need to
get something clear in my mind. I am concerned about the size of my forms.
I am concerned that if I put too much code in them they may run slow. These
are winforms, nothing to do with the net. In the enviroment I came from
(PowerBuilder) if your form got too big because of code, you just shuffled
off some of it into what VS thinks of as a module. I will do the same in VS
if need be but on the other hand, I don't want to create needless work for
myself. For example.

I just devised some code for a form that allows me to lookup information
using a slide out and a TreeView. The code really helps the navigational
issues for this form but, after all the code was written for
AfterSelectEvent, sub routines to find what node you are on, DoubleClick
events, fill this or that events etc. etc., it took up three pages (when
printed). I know already that this particular form is going to be big when
I add additional functionality because it is going to contain numerous tabs
and 1:m tables with a lot of error checking etc.

With the code I just mentioned, I could probably shuffle off about half or
maybe even two thirds of the code into a module. If this will help my
design I will do it but of course it takes more time, especially when you
have to pass various "sender" and "e" arguments etc. The thought occurs to
me that maybe VS doesn't think like my old tool in this respect. Maybe the
size of the form (in terms of the amount of code it contains) is not as big
a deal.

I don't know if I have explained myself well enough for someone to give a
general opinion but if someone would take a stab at it I would appreciate
it. How concerned should I be about form size and passing off code to a
module? This particular form is already at about 260 KB when you look at it
in Windows Explorer and contains about 3500 lines of code when you include
all the Windows form Designer generated code.
 
Are you saying that you have actually noticed a slow down from having a
large ammount of code in a form?

No, but I wonder if I will given all that I said in my earlier message.

Thanks for your reply.
 
No, but I wonder if I will given all that I said in my earlier message.

If you are not actually experiencing any "slow-down" so to speak then I
wouldn't worry about it. I wouldn't expect it to slow down unless it has
got allot to do, not just allot of code, the IDE might very well slow down,
but that isn't particularly hard for it (Need 512mb for good speed in the
IDE as I have just found out).

Nick.
 
I have a gig of memory on the machine that I design with. My concern has
more to do with what end users will experience.
 
Hello,

Woody Splawn said:
I have a gig of memory on the machine that I design with. My concern has
more to do with what end users will experience.

Do you use a lot of controls on the form?

Regards,
Herfried K. Wagner
 
Back
Top