i want to know how i can write the text of my String Array in multiple textboxes. For example i have an array of the length 5 so it should write inside the first five textboxes the text that is stored. The maximum is 14 textboxes that can be written. The string is filled with filenames that i read out of the given path and i want to display every filename in an textbox so the user can select which one he wants to use.
3 Answers
If you want the user to select a line of text, i would recommend to use a ListBox. The array should also be a List of strings.
The List for string would look like that:
List<string> texts = new List<string>();
Use to add sth to the List:
texts.Add("some text");
Finally to place every item in the list, use a foreach loop:
foreach (string item in texts)
{
listBox1.Items.Add(item);
}
Let me know if it works
1 Comment
Grover1221
Sorry, i for answering so late. Thanks it worked :D
<Textbox Text="{Binding variable[i}"in the xaml file, where variable is your array and i your index. I hope to be proved helpful