private void btnAddHour_Click(object sender, EventArgs e) { HourListBoxItem ListBoxItem = new HourListBoxItem(_ListBoxItems.Count, dpExecutionTime.Value.ToLongTimeString(), dpExecutionTime.Value); _ListBoxItems.Add(ListBoxItem); RefreshListbox(); }
private void btRemove_Click(object sender, EventArgs e) { if (lbHours.Items.Count > 0) { HourListBoxItem selectedItem = (HourListBoxItem)lbHours.SelectedItem; _ListBoxItems.Remove(selectedItem); RefreshListbox(); } }