New answers tagged

1

Each Control does have a property called Tag. This can contain/hold any kind of information since its type is object. Assign the Title, ... ,Url values to the corresponding TextBox's Tag: private readonly TextBox[] textBoxes = new [] { titleText, ... , urlText }; public Form1() { InitializeComponent(); titleText.Tag = "Title"; ... ...


1

you can use Dictionary to store the TextBoxs and their representive name, then just iterate over them, something like this : private bool ValidInput() { Dictionary<string, TextBox> textBoxes = new Dictionary<string, TextBox> { { "Title", titleText }, { "Artist", artistText }, { "Genre",...


Top 50 recent answers are included