Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Property setting in Design time Or Run time

Status
Not open for further replies.

xinyin

Programmer
Jan 16, 2003
81
HK
To set values for the properties of objects in a form, you can either do the property setting in the properites window (design time), or you can write codes such as textbox01.Width = 2000 (run time). I want to know if this will cause big difference to program performance. If there isn't big difference then please let me know which way you usually use. Thanks
 
Hi,
I'm not very sure about the difference in execution speeds but this is what I do.
I normally set the settings the way I need them to be as the program or the form shows for the first time on the properties window. When there's a situation during runtime that needs the change in properties, that's when I automate the necessary settings.
 
I agree. If for no other reason than to keep the code simpler I tend to put the initial settings in at design time. That's especially true for things like size and position attributes. It's a lot easier to get things the proper size and position in the form designer than it is my setting them at run time.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Setting properties at design time is probably a tiny bit quicker, since all the property info is sent in one block. However, a form that would show any degradation one way or the other would probably be so complicated that nobody would want to use it anyway, unless maybe there were huge amonuts of graphical data. Maybe that would be the way to test this, using multiple hires images in a picture box, setting the box up in design time and in run time and timing the difference.

Let us all know the results if you go to the trouble!

Bob
 
Size and position I find better to set at run time as there are many variables to this such as screen resolution, re-sizing of forms

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top