Quote:Okay, I'm Adding Items To Two ListBoxes During A Function, One For The Normal Plain Text, & Another For The MD5 Hash.
PasswordList.Items.Add(Password.Text) MD5ListBox.Items.Add(MD5.Text)
Quote:Everything Is Proceeding Successfully, Both The Plain Text & MD5 Hashes Are Adding To ListBoxes Perfectly, But When Removing The Same Indices Which I'm Removing In The Password List, I Want To Remove In The MD5 List Too. It's Functionally Completely When I Remove One Seleceted Item, But When I Remove More Than One Seleceted Item In The Password List I Get An Error When Removing From The MD5List. I'm Basically Getting The Selected Indices In The Password List, & Using A Loop To Remove The Same Indices Integers Selected In Password List, To Remove In MD5 List.
If PasswordList.SelectedItems.Count = 1 Then Dim KeyNumber As Integer = PasswordList.SelectedIndices(0) MD5ListBox.Items.RemoveAt(KeyNumber) PasswordList.Items.Remove(PasswordList.SelectedItem) Elseif PasswordList.SelectedItems.Count > 1 Dim KeyNumber5 = rdpForm.PasswordList.SelectedIndices For Each indx5 As Integer In KeyNumber5 rdpForm.MD5ListBox.Items.RemoveAt(indx5) Next Dim selectedItems = (From I In rdpForm.PasswordList.SelectedItems).ToList For Each selectedItem In selectedItems rdpForm.PasswordList.Items.Remove(selectedItem) Next End If
Quote:There's Always An Error When Removing Indices In The MD5List, But Here's An Example. ERROR: System.ArgumentOutOfRangeException: 'InvalidArgument=Value of '21' is not valid for 'index'. Parameter name: index' Items In ListBoxes(40), Attempting To Remove Indices(2-39)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)