private void categories_SelectedIndexChanged(object sender, EventArgs e) { if (categories.SelectedItems.Count > 0) { //show the tasks from selected category string categorySelected = categories.SelectedItem.ToString(); char[] delimiterChars = { '(' }; string[] words = categorySelected.Split(delimiterChars); int categoryId = CCategory.getCategoryId(words[0]); listViewToday.ResetText(); Login.h.today.Text = words[0]; CCategory.populateTasksFromCategory(listViewToday, categoryId); } }
private void categories_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { if (categories.SelectedItems.Count > 0) { //show the tasks from selected category string categorySelected = categories.SelectedItem.ToString(); char[] delimiterChars = { '(' }; string[] words = categorySelected.Split(delimiterChars); id_category = CCategory.getCategoryId(words[0]); contextMenuStrip1.Show(Cursor.Position); } } }