Created
April 16, 2011 07:28
-
-
Save takeshik/922951 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is Form | |
var textBoxes = this.Controls | |
.OfType<TextBox>() | |
.Where(t => t.Name.StartsWith("textBox")) | |
.OrderBy(t => Int32.Parse(t.Name.Substring("textBox".Length))) | |
.ToList(); | |
foreach (var _ in textBoxes.Select((t, i) => new { t, i, })) | |
{ | |
_.t.Text = "This is TextBox #" + _.i + "!"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment