type comparisons
i just browsed on the windows forms designer section of msdn forums and i see a post of this guy helping another about designers of course. what hit me was the way he tests if an object instance is of certain type
foreach(Control control in this.Controls)
{
if(control.GetType() == "System.Windows.Forms.TextBox")
{
//do whatever...
}
}
i hate string comparisons for determining types and you should refrain from doing the above code and use this:
foreach(Control control in this.Controls)
{
TextBox textBox = control as TextBox;
if(textBox != null)
{
//do whatever...
}
}