Example #1
0
 private void LabelBox_KeyDown(object sender, KeyEventArgs e)
 {
     if ((e.Key == Key.Return || e.Key == Key.Enter) && sender is TextBox textbox)
     {
         NewToDoTextBox.Focus();
     }
 }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            readerWriter = new ReaderWriter();

            todos = readerWriter.LoadToDos();
            NewToDoTextBox.MaxLength = ToDo.MaxNameLenght;
            NewToDoTextBox.Focus();

            DisplayToDoList();
        }
Example #3
0
 private void AddToDoButton_Click(object sender, RoutedEventArgs e)
 {
     if (NewToDoTextBox.Text != "")
     {
         todos.Add(new ToDo(NewToDoTextBox.Text, false));
         ToDoListView.Items.Refresh();
         readerWriter.SaveToDos(todos);
         NewToDoTextBox.Text = "";
         ScrollListToBottom();
     }
     NewToDoTextBox.Focus();
 }