I have an existing menustrip with &Files->&Recent Files. An xml file contains up to 10 file names that I want to add to a Recent Files submenu. The submenu needs to be dynamically maintained whenever the most recent list changes. The following code is as far as I have gotten. How can I add the InnerText to the menu, and how can I remove it when needed?
XmlDocument myXmlDocument = new XmlDocument(); myXmlDocument.Load("recentFiles.xml"); XmlNode rootNode; rootNode = myXmlDocument.DocumentElement; foreach (XmlNode xNode in rootNode.ChildNodes) { if (xNode.InnerText != "") { Console.WriteLine(xNode.InnerText); } }
Experience trumps brilliance -- Thomas Sowell