silverlight - binding data into the List box -
How can tie in a list box from a text box in silver light? I have 5 text boxes and click on save time button, the list box will flll with the data displayed in the text box. How will this be done in silver light?
Do something you want to do:
XML:
& lt; StackPainel & gt; & Lt; ListBox x: name = "lbStrings" & gt; & Lt; / ListBox & gt; & Lt; Text Box X: Name = "TB1" width = "50" & gt; & Lt; / Text box & gt; & Lt; Text Box X: Name = "TB2" width = "50" & gt; & Lt; / Text box & gt; & Lt; Text Box X: Name = "TB3" width = "50" & gt; & Lt; / Text box & gt; & Lt; Text Box X: Name = "TB4" width = "50" & gt; & Lt; / Text box & gt; & Lt; Text Box X: Name = "TB5" width = "50" & gt; & Lt; / Text box & gt; & Lt; Button click = "save" content = "save" /> & Lt; / StackPanel & gt;
Code-Back:
Save Private Zero (Object Sender, RoutedEventArgs e) {//lbStrings.Items.Clear (); // if necessary lbStrings.Items.Add (string.Format ("{0} - {1} - {2} - {3} - {4}", tb1.Text, tb2.Text, tb3.Text, Tb4. Text, TB 5. text)); }
Comments
Post a Comment