I want to locate a TextBox named "textBoxQH_N" where "_N" is a number from 1..96.
So, I've got this code:
String sTextBoxToFind = String.Format("textBoxQH{0}", QuarterHour);
TextBox tb = (TextBox)this.Controls.Find(sTextBoxToFind, true);
...but it gave me, "Cannot convert type 'System.Windows.Forms.Control[]' to 'System.Windows.Forms.TextBox'"
So I changed the second line to grab just the first returned val:
TextBox tb = (TextBox)this.Controls.Find(sTextBoxToFind, true)[0];
Which seems to work, but shouldn't a Control's Name property be unique to its owner? IOW, Find() should only return 0..1 controls, right?