Folks,
I have a form which contains a listbox, which I'm using to display a running log to the user.
The application retrieves data from a database and then processes it. What should happen is when the user clicks on the button to set the application running I add an item to the listbox stating that data is being fetched from the database. When the data is retrieved, I add another item to the listbox to state the data has been retrieved and is now processing.
What is actually happening is that when the user clicks the button, the listbox remains empty. The query can take some time to run (several seconds). Once the data is retrieved, both messages appear in the listbox at once. The messages are timed and I can see there are several seconds between them, even though they appear together.
I'm trying to delay the query, until the first message is displayed, but can't seem to find an event for an item being added to the listbox which I could use to trigger the query.
Any ideas how I can solve this?
I have a form which contains a listbox, which I'm using to display a running log to the user.
The application retrieves data from a database and then processes it. What should happen is when the user clicks on the button to set the application running I add an item to the listbox stating that data is being fetched from the database. When the data is retrieved, I add another item to the listbox to state the data has been retrieved and is now processing.
What is actually happening is that when the user clicks the button, the listbox remains empty. The query can take some time to run (several seconds). Once the data is retrieved, both messages appear in the listbox at once. The messages are timed and I can see there are several seconds between them, even though they appear together.
I'm trying to delay the query, until the first message is displayed, but can't seem to find an event for an item being added to the listbox which I could use to trigger the query.
Any ideas how I can solve this?
Last edited: