CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Fort Worth Texas
    Posts
    614

    Question Refresh of WPF controls

    Attached is a small simple VB.NET app that loads a Listview with some items. I want the items to appear as I add them but right now they do not appear until all of the items are added. What do I have to do to get an added item to appear as I add them? Thank you
    Attached Files Attached Files
    Last edited by Jim Bassett; September 30th, 2009 at 03:46 PM. Reason: Make problem clearer and note an attachment has been added

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Refresh of WPF controls

    I would recommend is using an ObservableCollection and bind the listbox to the collection.

    That way you can add/remove items to the collection and the listbox will automatically display the changes. Also, you probably want to set it up in the Loaded event instead of ContentRendered event.

    I don't code in VB, but here's a link to a sample:

    http://blogs.msdn.com/bethmassi/arch...-entities.aspx

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