private void updateSuggestionPageDisplay()
{
int index = listBox1.SelectedIndex;
int entriesInView = Globals.ThisAddIn.EntriesInView;
suggestionSizeLabel.Text = pageIndex + " of " + numOfPage;
// remove previous entries
listBox1.Items.Clear();
displaySuggestion.Clear();
int entryIndex = 1;
for (int i = (pageIndex-1)*entriesInView, j = entriesInView;
i < suggestions.Count && j > 0;
i++, j--)
{
listBox1.Items.Add(suggestions[i]);
displaySuggestion.Add(suggestions[i]);
entryIndex++;
}
ListBox_initWidth(listBox1);
if (index < listBox1.Items.Count)
{
listBox1.SelectedIndex = index;
}
else
{
listBox1.SelectedIndex = listBox1.Items.Count - 1;
}
}