![]() |
|
[VB.Net] Making a cool File/Directory Search - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: [VB.Net] Making a cool File/Directory Search (/Thread-VB-Net-Making-a-cool-File-Directory-Search) |
RE: [VB.Net] Making a cool File/Directory Search - Deque - 03-24-2013 If the GUI stops responding use a separate thread to make the search. RE: [VB.Net] Making a cool File/Directory Search - Deque - 03-24-2013 If the GUI stops responding use a separate thread to make the search. RE: [VB.Net] Making a cool File/Directory Search - Coder-san - 03-24-2013 (03-24-2013, 09:01 AM)Deque Wrote: If the GUI stops responding use a separate thread to make the search. Yeah. This example doesn't mention the use of a new thread, but that's what I did back in the day. But the constant update of the resource-hungry ListView control is not the best practice. RE: [VB.Net] Making a cool File/Directory Search - Coder-san - 03-24-2013 (03-24-2013, 09:01 AM)Deque Wrote: If the GUI stops responding use a separate thread to make the search. Yeah. This example doesn't mention the use of a new thread, but that's what I did back in the day. But the constant update of the resource-hungry ListView control is not the best practice. RE: [VB.Net] Making a cool File/Directory Search - ArkPhaze - 03-24-2013 You should use the BeginUpdate() and EndUpdate() methods. It would help here... RE: [VB.Net] Making a cool File/Directory Search - ArkPhaze - 03-24-2013 You should use the BeginUpdate() and EndUpdate() methods. It would help here... RE: [VB.Net] Making a cool File/Directory Search - Coder-san - 03-24-2013 (03-24-2013, 02:36 PM)ArkPhaze Wrote: You should use the BeginUpdate() and EndUpdate() methods. It would help here... Simply using them would test the patience of the user. Then the ListView will only update when search has finished. We'll have to set it to update after every 100 or so results. But those are extra perks which I've left for the programmer to figure out. This thread basically shows how to do a file search and grab icons of the files to show them as if in Explorer. RE: [VB.Net] Making a cool File/Directory Search - Coder-san - 03-24-2013 (03-24-2013, 02:36 PM)ArkPhaze Wrote: You should use the BeginUpdate() and EndUpdate() methods. It would help here... Simply using them would test the patience of the user. Then the ListView will only update when search has finished. We'll have to set it to update after every 100 or so results. But those are extra perks which I've left for the programmer to figure out. This thread basically shows how to do a file search and grab icons of the files to show them as if in Explorer. RE: [VB.Net] Making a cool File/Directory Search - ArkPhaze - 03-24-2013 (03-24-2013, 05:52 PM)Coder-san Wrote:(03-24-2013, 02:36 PM)ArkPhaze Wrote: You should use the BeginUpdate() and EndUpdate() methods. It would help here... That is my point though. You don't want to be having to reInvalidate() the control each time. You're using the results of the search to loop through, and add items individually from what I see: Code: For Each Item As String In IO.Directory.GetFiles(strPath, "*.*", IO.SearchOption.AllDirectories)
'Adding stuff here
NextThus every iteration the control has to be redrawn to show the new Item. Seems like an old piece of code that got bumped though so I won't be trying to go over the code in too much more detail. RE: [VB.Net] Making a cool File/Directory Search - ArkPhaze - 03-24-2013 (03-24-2013, 05:52 PM)Coder-san Wrote:(03-24-2013, 02:36 PM)ArkPhaze Wrote: You should use the BeginUpdate() and EndUpdate() methods. It would help here... That is my point though. You don't want to be having to reInvalidate() the control each time. You're using the results of the search to loop through, and add items individually from what I see: Code: For Each Item As String In IO.Directory.GetFiles(strPath, "*.*", IO.SearchOption.AllDirectories)
'Adding stuff here
NextThus every iteration the control has to be redrawn to show the new Item. Seems like an old piece of code that got bumped though so I won't be trying to go over the code in too much more detail. |