示例#1
0
        private void MoveNote(int direction)
        {
            if (NotesListBox.Items.Count == 0 ||
                NotesListBox.SelectedIndex == -1 ||
                (NotesListBox.SelectedIndex == 0 && direction == -1) ||
                (NotesListBox.SelectedIndex == NotesListBox.Items.Count - 1 && direction == 1))
            {
                return;
            }

            NotesListBox.SelectedIndex += direction;
            NotesListBox.ScrollIntoView(NotesListBox.SelectedItem);
        }
示例#2
0
 private void ScrollListBox(int index)
 {
     NotesListBox.ScrollIntoView(NotesListBox.Items[index]);
 }
示例#3
0
 private void ScrollListBox()
 {
     NotesListBox.ScrollIntoView(NotesListBox.Items[NotesListBox.Items.Count - 1]);
 }