treeview - Whats the best way to do throbber in C#? -


specifically looking make icons nodes in system.windows.forms.treeview control throb while long loading operation taking place.

if load each frame imagelist, can use loop update each frame. example:

    bool runthrobber = true;     private void animatethrobber(treenode animatednode)     {         backgroundworker bg = new backgroundworker();         bg.dowork += new doworkeventhandler(delegate         {             while (runthrobber)             {                 this.invoke((methodinvoker)delegate                 {                     animatednode.selectedimageindex++;                     if (animatednode.selectedimageindex >= imagelist1.images.count) > animatednode.selectedimageindex = 0;                 });                 thread.sleep(100);             }         });         bg.runworkerasync();     } 

obviously there's more few ways implement this, here's basic idea.


Comments