sorry i do not think i understand. I entered this code into a c# application:
but i get a nullreferenceexeption error.Code:namespace test { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { TextBox[] textBoxArray = new TextBox[10]; for (int i = 1; i < 5; i++) { textBoxArray[i].Text = "whatever"; } } } }
TheGreatCthulhu the code you gave, gave me two errors:
Error 1 The best overloaded method match for 'System.Collections.Generic.List<System.Windows.Forms.TextBox>.Add(System.Windows.Forms.TextBox)' has some invalid arguments C:\Users\Dave\AppData\Local\Temporary Projects\test\Form1.cs 26 21 test
Error 2 Argument 1: cannot convert from 'System.Windows.Forms.Control' to 'System.Windows.Forms.TextBox' C:\Users\Dave\AppData\Local\Temporary Projects\test\Form1.cs 26 30 test




Reply With Quote