/** * Function: FocusInput * * Focuses the user's view onto the main text box on launch. * * Author: wellinthatcase * * Date: 12/22/2020 * * Param: * sender - Source of the event. * e - Routed event information. */ private void FocusInput(object sender, RoutedEventArgs e) { if (!NoteName.Focus()) { MessageBox.Show( "Hi there,\r\n\r\nI tried focusing onto the text box " + "you're about to see, but it failed. For reference," + " click right above the dark red line :)"); } }
private void New_Button_Click(object sender, RoutedEventArgs e) { NoteName.Text = "New Title"; NoteSpace.Text = "New Note"; NoteSpace.Background = Brushes.LightGreen; Save_Button.Background = Brushes.Green; Save_Button.IsEnabled = true; Save_Button.Content = "Save"; NoteName.Focus(); NoteName.SelectAll(); }