For example, every time somebody tries to rename file to “ My new name ” we should actually remove all that extra spacing and use “My new name“. Obvious solution would be to do e.Label = e.Label.Trim(). However, that code does not even compile. Time for tricks…

If we detect whitespace we can just cancel everything. That will prevent ListView from making any changes to our item. Then we can be sneaky and change item ourselves: