Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to update listview ONLY when new data is avilable in vb6?

How to update listview ONLY when new data is avilable in vb6?

Scheduled Pinned Locked Moved Visual Basic
xmlhelptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    method007
    wrote on last edited by
    #1

    Hi all. I have seen many applications that listview ONLY updates when new data is avilable or when current data changes. I am making an application that deals with similar case. But i don't know how these applications achive this task. I tried to use timer to refresh my listview every few seconds(I am loading data from dynamic xml to listview.)But there is a big problem that i keep losing focus on the form and i see many unnecessary refreshes!! Could any one show me a better solution to avoid these unnecessary refreshes?I know these professional applications are using a method that i am not aware of.Thanks

    D 1 Reply Last reply
    0
    • M method007

      Hi all. I have seen many applications that listview ONLY updates when new data is avilable or when current data changes. I am making an application that deals with similar case. But i don't know how these applications achive this task. I tried to use timer to refresh my listview every few seconds(I am loading data from dynamic xml to listview.)But there is a big problem that i keep losing focus on the form and i see many unnecessary refreshes!! Could any one show me a better solution to avoid these unnecessary refreshes?I know these professional applications are using a method that i am not aware of.Thanks

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The solution is surprisingly simple and you use them every day. They're called "events". If you break your application into seperate layers for UI, business logic, and data, the opportunity to create your own events that signal changes in the data becomes clear. Then all you have to do is subscribe to those events in your UI code and you've got your solution.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        The solution is surprisingly simple and you use them every day. They're called "events". If you break your application into seperate layers for UI, business logic, and data, the opportunity to create your own events that signal changes in the data becomes clear. Then all you have to do is subscribe to those events in your UI code and you've got your solution.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        M Offline
        M Offline
        method007
        wrote on last edited by
        #3

        Dave thank you for reply.I am not very experienced vb6 developer.So i need some more information about this process. In my case i have a listview that it gets data from a dynamic xml file. I use timer to re populate the listview every few seconds. Obviously this cause lots of flicking and lose of form focus and i see lots of unnecessary listview reloads. Could you consider this case and let me know how to reload listview ONLY when new data has arrived. I have seen it many applications doing that but don't know how they do it!! Looking forward for some examples.Thanks

        D 1 Reply Last reply
        0
        • M method007

          Dave thank you for reply.I am not very experienced vb6 developer.So i need some more information about this process. In my case i have a listview that it gets data from a dynamic xml file. I use timer to re populate the listview every few seconds. Obviously this cause lots of flicking and lose of form focus and i see lots of unnecessary listview reloads. Could you consider this case and let me know how to reload listview ONLY when new data has arrived. I have seen it many applications doing that but don't know how they do it!! Looking forward for some examples.Thanks

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Since you're reading from an XML file every few seconds, there isn't a simple solution to this. You'd have to implement your own method of detecting changes in the file, like checking the Modified date/time on the file, in order to fire the event.

          method007 wrote:

          Looking forward for some examples

          I don't have any.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups