views:

38

answers:

1

I'm not sure if I got my terms straight here, but I was wondering:

Is creating objects in run-time faster than adding objects to a form before running it?

In case my terms are messed up, in the load function, you add this:

lOptions.AutoSize = true;
lOptions.Location = new System.Drawing.Point(7, 75);
lOptions.Name = "lOptions";
lOptions.Size = new System.Drawing.Size(117, 13);
lOptions.TabIndex = 17;
lOptions.Text = "text";
lOptions.Click += new System.EventHandler(this.lOptions_Click);
gbModify.Controls.Add(lOptions);

I heard it's part of working Object-Oriented. I'm not asking you to tell me what Object-Oriented is ofcourse, but I was just wondering which method is better.

I guess it wont make much of a difference if you only have 3 labels to create, but at the moment I have to create about 30 labels and 30 comboboxes.

+2  A: 

If you add a Control with the WinForms designer, the designer creates code in your Form1.Designer.cs files.

So there is absolutely no difference in speed.

Henk Holterman
Aah, ofcourse. Why didn't I think of that.. >.<
Nick