Shamil Salakhetdinov
shamil at users.mns.ru
Sat May 12 09:33:01 CDT 2007
John, I think you'd better currently use custom events as you do in VBA using WithEvents. You can even do more "tricks": VB.NET (.NET Framework) generalizes this idea of custom events and their sinking - read about the concept of delegates and how to handle them. If you're thinking about making your program multi-threaded then you will have to solve some more complicated issues related to the fact that the calls from worker threads can't in general case result in form's properties or form controls' properties updates, IOW an event raised in a worker thread can't/shouldn't be processed by the main thread running the form... Here is where delegates can sole the issue or BackgroundWorker component (http://www.codeguru.com/columns/vb/article.php/c10755/ )... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, May 12, 2007 5:40 PM To: 'Access Developers discussion and problem solving'; dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Progress Bars I need two progress bars, one for displaying the files I am processing, and one for displaying the progress processing records inside of a file. My question involves where to display this progress and how to feed the individual bars. The progress info is coming from two different classes, neither of which is the form class. Would I raise events and have those events sunk clear back on the form class, or would I pass in references to the progress controls to the classes, or would I make public variables which hold pointers to the progress bars and allow each class to update it's own progress bar? How do you guys do this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com