CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Location
    Mnila, Philippines
    Posts
    171

    Update the listbox

    I have a listbox and it add an item when I click the button. My problem is, it doesn't show the item that was added until the process is not yet finish. What I want is that every time I insert string in the listbox, it will show that the item is added one by one. I try to use the refresh but nothing happen.

    Any Suggestions... Thanks guys.

  2. #2
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: Update the listbox

    you could do this...

    Code:
    for (int i = 0; i < 10; i++)
    {
         listBox1.Items.Add(i.ToString());
         Application.DoEvents();
    }
    Thats the simple answer.
    ===============================
    My Blog

  3. #3
    Join Date
    Jul 2006
    Location
    Mnila, Philippines
    Posts
    171

    Re: Update the listbox

    Thanks. That's what I'm looking for. I used this in vb.net but I can't remember the syntax.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured