Resizing Array (a question about TextBox)
-
The RichText and the TextBox controls have the property Lines that of type string[]. Any idea how the controls handle the resizing of the Array? I want to know because I want to use an Array, which will hold properties for each Line of the TextBox control. Or do you have any suggestion what should I do best?
-
The RichText and the TextBox controls have the property Lines that of type string[]. Any idea how the controls handle the resizing of the Array? I want to know because I want to use an Array, which will hold properties for each Line of the TextBox control. Or do you have any suggestion what should I do best?
-
The RichText and the TextBox controls have the property Lines that of type string[]. Any idea how the controls handle the resizing of the Array? I want to know because I want to use an Array, which will hold properties for each Line of the TextBox control. Or do you have any suggestion what should I do best?
You could store each of your lines in an ArrayList, which autosizes for you when you
Add
orRemove
. As long as you only put strings in there, you can use 1 simple line when you want to assign the lines:string [] lines = (string[])myArrayList.ToArray(typeof(string));
Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour -
The RichText and the TextBox controls have the property Lines that of type string[]. Any idea how the controls handle the resizing of the Array? I want to know because I want to use an Array, which will hold properties for each Line of the TextBox control. Or do you have any suggestion what should I do best?
the TextBox controls create a new string[] everytime you request the Lines property. It is not stored; it's generated on-the-fly. As a side note (not that it will help you here) but one can resize an array using the Array.Resize static method.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango