In a web browser app, the history of pages visited by users are being listed in a TreeView. When a node is right-clicked in the TreeView, a menu appears (similar to IE). Users have also been given the option to view history by date, by domain & by order visited (again similar to IE).
It is possible that a user visits the same web page multiple times in which case the title of the web page visited multiple times will obviously be the same. It is also possible that though the URLs of web pages will be different, their titles will be the same. This means that when a user views his history by order of the pages he has visited, pages with the same title or pages with the same title but different URLs will be listed more than once in the TreeView.
Hence when a node is right-clicked in the TreeView, I would like to give users the option to delete multiple pages in the TreeView either by the web page title or by the web page URL at one go. Using the following code, I can extract the titles & URLs of the web pages:
Now how do I loop through the TreeView nodes to find out which nodes' titles are the same & which nodes titles are the same but the URLs are different & then delete all of them at the same time?Code:Private Sub DeleteHistory() MsgBox "Page Title: " & tvwHistory.SelectedItem.Text MsgBox "Page URL: " & tvwHistory.SelectedItem.Tag End Sub
Note that the right-click menu will have two options to delete history - Delete All References By Title & Delete All References By URL.




ARPAN
Reply With Quote