pixel pix

pixel pix

  • NA
  • 5
  • 2.2k

Strange behaviour in a program that use ListView

Oct 26 2012 4:18 AM

The software that I'm developing in C # using SharpDevelop behaves in a strange way. I'll try to describe it briefly, although I know that it will not be easy.
I have a window in which I have three ListView. Clicking on a button through a for loop I populate these three ListView with simple text strings coming from a List already populated. The filling and the display is not immediate. In fact, I want each row to appear every few milliseconds, and for this I use System.Threading.Thread.Sleep.
Well, when I run the software from making within the development environment, it behaves the way I want without any problem, but when I run the software on the outside, simply by double-clicking the executable, when I press the button to show the contents of the ListView, a strange thing happens,… the ListView began to be populated, and the lines began to compare on the screen according to the delay set by me, then at a certain point the program seems like it locks... in the listview doesn't appear anything and the only thing I see is the mouse cursor letting me know that the program is working. In fact, the program has not crashed, is continuing to follow the instructions and only when it arrives at the end of the for loop becomes available again and shows the listview filled with all the remaining strings. The problem is that, for example, from the string 21 to 200 I have not seen any row appearing on the screen as I wanted.

What could be the explanation for this strange behaviour? Does anyone have any idea on how to solve it?


Answers (4)