private void listBoxFavs_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Up)
{
listBoxFavs.SelectedIndex = (listBoxFavs.SelectedIndex + listBoxFavs.Items.Count - 1) % listBoxFavs.Items.Count;
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.Down)
{
listBoxFavs.SelectedIndex = (listBoxFavs.SelectedIndex + 1) % listBoxFavs.Items.Count;
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.Enter)
{
if (((ListBoxEntry)listBoxFavs.SelectedItem).title == "- Add Current URL")
{
formKeyboard = new FormKeyboard("Enter shortcut title:", "", true, allKeys);
formKeyboard.ShowDialog();
if (formKeyboard.textBox1.Text != "")
{
String title = formKeyboard.textBox1.Text;
File.AppendAllText(userDataFolder + "\\shortcuts\\" + mainTitle + ".links", title + "=" + currentUrl + "\n");
importShortcuts();
}
}
else
this.Close();
}
}