|
-
March 31st, 2006, 11:24 AM
#3
Re: ListBox problem
Adding a string into the listbox means a message is sent to the listbox. To see the change the window holding the listbox needs to refresh itself and allow the listbox to to the same.
But with this algorithm you are using the application's main thread ( the UI thread) is blocked in the Onbuttonclick function so no message gets processed until the function finishes.
You have 2 options:
1. the nice way: use a thread to do the file processing and from that thread sent messages to the UI thread to add strings into the listbox
2. the old way: process the window messages yourself. See this article for more details
Har Har
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|