private void FocusNoteBox() { NoteTextBox.Focus(); if (!string.IsNullOrEmpty(NoteTextBox.Text) && NoteTextBox.CaretIndex <= 0) { NoteTextBox.CaretIndex = NoteTextBox.Text.Length; } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (this.Opened != null) { this.Opened(this, new PopupEventArgs()); } preNote = NoteTextBox.Text; NoteTextBox.Focus(); NoteTextBox.SelectionStart = NoteTextBox.Text.Length; }
private void AddButton_Click(object sender, EventArgs e) { // Get the selected key in the combo box. string key = (string)KeysComboBox.SelectedValue; // Get the text entered by the user. string noteValue = NoteTextBox.Text; // Add the note text to the selected key. _theAccount.Notes.Add(key, noteValue); // Redisplay the notes. DisplayNotes(); NoteTextBox.Clear(); NoteTextBox.Focus(); }
private void NoteTextBox_TextChanged(object sender, EventArgs e) { //Zapisuje text napsaný do NoteTextBox-u do proměnné noteText noteText = NoteTextBox.Text; NoteTextBox.Focus(); //Zařizuje počítání znaků do poznámky chars = NoteTextBox.Text; size = chars.Length; charNumber -= size; TextLengthCounter.Text = charNumber.ToString(); if (charNumber < 1) { TextLengthCounter.Text = "Chyba"; } charNumber = 2000; }
public BasicNoteView() { InitializeComponent(); NoteTextBox.Focus(); }