Login Register


[VB.Net] Making a cool File/Directory Search filter_list
Author
Message
RE: [VB.Net] Making a cool File/Directory Search #11
If the GUI stops responding use a separate thread to make the search.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: [VB.Net] Making a cool File/Directory Search #12
If the GUI stops responding use a separate thread to make the search.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: [VB.Net] Making a cool File/Directory Search #13
(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.
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: [VB.Net] Making a cool File/Directory Search #14
(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.
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: [VB.Net] Making a cool File/Directory Search #15
You should use the BeginUpdate() and EndUpdate() methods. It would help here...
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply

RE: [VB.Net] Making a cool File/Directory Search #16
You should use the BeginUpdate() and EndUpdate() methods. It would help here...
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply

RE: [VB.Net] Making a cool File/Directory Search #17
(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.
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: [VB.Net] Making a cool File/Directory Search #18
(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.
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: [VB.Net] Making a cool File/Directory Search #19
(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...

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.

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 Next

Thus 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.
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply

RE: [VB.Net] Making a cool File/Directory Search #20
(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...

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.

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 Next

Thus 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.
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply







Users browsing this thread: 1 Guest(s)