public void createList() { Listbox.ItemsSource = factormap; Listbox.Width = 500; KeyboardNavigation.SetTabNavigation(Listbox, KeyboardNavigationMode.Cycle); //Scroll to the bottom Listbox.SelectedIndex = Listbox.Items.Count - 1; Listbox.ScrollIntoView(Listbox.SelectedItem); }
private void AddBtn_Click(object sender, RoutedEventArgs e) { string tmp = txtBox.Text.ToLower().Title(); PassableList.Add(tmp); txtBox.Text = String.Empty; Listbox.ScrollIntoView(PassableList[PassableList.Count() - 1]); using (StreamWriter write = new StreamWriter(@"..\..\Resources\wordPoolData.txt", true)) { write.WriteLine(tmp); } }