Setting Windows Forms Properties Design Time vrs Run Time

  • Thread starter Thread starter cleo
  • Start date Start date
C

cleo

In VB6 my practice was to set control properties at Run Time rather than
Design Time. I found setting property values in the code provided better
documentation, since much of this was hidden - and if there were problems
with a control dll setting values were preserved and not "lost" to the
domain of searching code using a DOS editor.

However, as I start work in VB.Net I'm questioning if I should continue my
practice of avoiding Design Time properties or if the code would be easier
to read and manage if I begin to use Design Time properties.

Thanks for any and all opionions.
 
Hi Cleo,

All your what you call design time properties are visable when you push on
the + in the designer hidden part of your program and you will see that it
are normal what you call run time properties.

So in my opinion the best way is to do it in a way that adds to the
documentation, however setting the wide of a textbox by hand does not add
much to that in my opinon.

I hope that this was the question and answers it?

Cor
 
cleo said:
In VB6 my practice was to set control properties at Run Time
rather than Design Time. I found setting property values in the
code provided better documentation, since much of this was
hidden

Mhm... You could easily have a look by selecting the control in the form
editor and checking the properties. I never had a problem with that and
there were only a few cases where opening the form file with notepad, for
example, was necessary.
However, as I start work in VB.Net I'm questioning if I
should continue my practice of avoiding Design Time properties
or if the code would be easier to read and manage if I begin
to use Design Time properties.

As Cor says, the code can be shown inside the code editor (or in a partial
class in VB 2005). By removing '<System.Diagnostics.DebuggerStepThrough()>'
from the 'Sub InitializeComponent' you can debug the code.
 
Cor and Herfried
Thanks for the input.

The Windows Designer Section does nicely expose the information and it does
seem to be a waste of time to repeat many settings manually.

Generally I've grown to avoid Designers and Wizards but I'd like to learn to
use them wisely. I'm still on the learning curve, but if I have any real
problems I'll post.
 
Back
Top