I make a simple file manager (ala explorer), in principle I have already done almost everything, but I understand that I did absolutely wrong to update the files from the current folder. I made a regular timer to clear the list and request for the content in the folder of files and folders, because of what flicker and other problems occur, and in general it seems to me absolutely wrong. How to do?

PS I'm just learning to write in C # so please write with more simple concepts.

  • one
    Make an update either at the user's command, or after the form is activated, or after some event (creating, deleting a file / folder), or combine it altogether. - Donil

1 answer 1

Transferred the comment in response and added. Make an update in three cases:

1) По команде пользователя 2) По событию создания, удаления, переименование файла/папки 3) По событию активации формы 

I think they will be quite enough.

Also in C # there is a class FileSystemWatcher . He has events on various changes. You can subscribe to the desired event and update the list.