Recent Files Menu Management
-
Hello All, Does anybody have any neat code (VB.NET) to manage the "recent files" part of a main menu like in WORD. I'm using just a simple note editor and i'm going crazy over the logic although i'm sure it's simple. To start with I read in 4 files from a *.ini file and create the menuitems having declared the menu array name at form level: 'at form level Dim RecentFile(3) as MenuItem 'at frm_Load to create menuitems after reading file names/path from *.ini file ...RecentFile(3)=New MenutItem (FileString(4)) Read files then create menuitems.. mnuMain.MenuItems.Add(RecentFile(I)) Then from the Open file event using the OpenDialog box..I have Filename=dlgOpen.Filename This then passes to a subroutine to sort the recent files and delete any file that was the same as the current one. so.. FileString(1)= RecentFile 1 from last edit/open/new procedure FileString(2)= RecentFile 2 from last edit/open/new procedure FileString(3)= RecentFile 3 from last edit/open/new procedure FileString(4)= RecentFile 4 from last edit/open/new procedure I'm looking for code that puts the new Filename in the top position but also deletes any of the existing ones if they are the same as Filename. Thanks for your help.