diff --git a/src/ui/Forms/Assa/AdvancedSelectionHelper.Designer.cs b/src/ui/Forms/Assa/AdvancedSelectionHelper.Designer.cs index 413d47b53..a65314b08 100644 --- a/src/ui/Forms/Assa/AdvancedSelectionHelper.Designer.cs +++ b/src/ui/Forms/Assa/AdvancedSelectionHelper.Designer.cs @@ -109,6 +109,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa this.listViewFixes.TabIndex = 1; this.listViewFixes.UseCompatibleStateImageBehavior = false; this.listViewFixes.View = System.Windows.Forms.View.Details; + this.listViewFixes.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listViewFixes_ItemChecked); // // columnHeaderApply // diff --git a/src/ui/Forms/Assa/AdvancedSelectionHelper.cs b/src/ui/Forms/Assa/AdvancedSelectionHelper.cs index a92281ad9..179aed740 100644 --- a/src/ui/Forms/Assa/AdvancedSelectionHelper.cs +++ b/src/ui/Forms/Assa/AdvancedSelectionHelper.cs @@ -97,7 +97,9 @@ namespace Nikse.SubtitleEdit.Forms.Assa } Indices = indices.ToArray(); + listViewFixes.ItemChecked -= listViewFixes_ItemChecked; listViewFixes.Items.AddRange(listViewItems.ToArray()); + listViewFixes.ItemChecked += listViewFixes_ItemChecked; listViewFixes.EndUpdate(); groupBoxPreview.Text = string.Format(LanguageSettings.Current.ModifySelection.MatchingLinesX, listViewFixes.Items.Count); listViewFixes.AutoSizeLastColumn(); @@ -187,5 +189,18 @@ namespace Nikse.SubtitleEdit.Forms.Assa e.SuppressKeyPress = true; } } + + private void listViewFixes_ItemChecked(object sender, ItemCheckedEventArgs e) + { + if (e.Item == null) + { + return; + } + + if (int.TryParse(e.Item.Tag.ToString(), out var index)) + { + Indices = Indices.ToList().Where(p => p != index).ToArray(); + } + } } }