چطور میشه خطوط تکست باکس رو مدیریت کرد؟؟
مثلا میخوام فقط خط دوم رو بخونم
یا یک مقدار یک عددی رو فقط تو خط سوم تکست باکسم نمایش بدم؟
چطور میشه خطوط تکست باکس رو مدیریت کرد؟؟
مثلا میخوام فقط خط دوم رو بخونم
یا یک مقدار یک عددی رو فقط تو خط سوم تکست باکسم نمایش بدم؟
MSDN
// Create a string array and store the contents of the Lines property.
string[] tempArray = textBox1.Lines;
// Loop through the array and send the contents of the array to debug window.
for(int counter=0; counter < tempArray.Length;counter++)
{
System.Diagnostics.Debug.WriteLine(tempArray[counter]);
}
میتونید مستقیما هم خط مورد نظر را رو بخونید:
this.textBox1.Lines[2];