Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to fill a ListBox with a background worker in .Net2.0?
    primarykey
    data
    text
    <p>In my application a ListBox is filled after a user puts more than two characters into a textBox.</p> <p>If there is a lot to fill into the ListBox, the user has to wait until the ListBox is completely filled before is able to continue his input.</p> <p>Now I need a solution to fill the ListBox without blocking the UI, so I would like to use a background worker to solve this.</p> <p>---- Original Version -----</p> <p>In my application I fill a ListBox when the user puts in more then two characters into a textBox. The ListBox fills with results and after this, the user is able to put in more characters.</p> <p>My problem is the following behaviour: The user is only able to put in the next char <em>after</em> the whole ListBox is filled with all entries. If there are a lot of results the user has to wait until he is able to continue.</p> <p>I would like to have the following behaviour: If the user puts in a char, the filling of the ListBox should stop and build the list for the new input.</p> <p>I thought about sth. like:</p> <pre><code>[PSEUDO-CODE] loop over results { if (UserInput) { // &lt;-- GetKeyState()? break } AddOneItemToListBox } [/PSEUDO-CODE] </code></pre> <p>I thought about sth. like GetKeyState() but I think there should be a more elegant way (perhaps a control or another technology I don't know about ATM).</p> <p>P.S.: Currently I'm looking for a solution with .Net2.0, but if there is a technology inside a later version of .Net I would also be glad for a short hint (just for my information).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload