I have a CheckedListBox on a backup application I am writing.
I want the user to pick the folders they want backing up i.e. desktop
I have my for loop working for each ticked item etc but I want the user to see the tick box labeled as “Desktop” rather than c:\users\username\desktop
Can someone inform me how to change the listbox label to something different than what is actually being returned to my for loop.
You should create a type that holds the full path and override ToString() to return what you want to display in the CheckedListBox. CheckedListBox.SelectedItems will then hold a list of your type.
you could of course strip the folder name from the path if that is what you wanted to do for every list item and just have the path arg on the BackupDir class.