How do you get around not having Callbacks?

  • Thread starter Thread starter M. Said
  • Start date Start date
M

M. Said

First, let me start by saying I am new CF.

I have a class DB.cs that does Database function. this class has a
method called processRecords().

I also have 2 forms, F1.cs and F2.cs, both have a button and a progress bar.

When I press the button on either form, I would like to execute
DB.processRecords() (in a thread if possible - not sure about this yet)
and update the UI progressBar in the form that called DB.processRecords().

How is this done in CF without using Callbacks? any examples?

Thanks in advance.

M. Said
 
Use a delegate. There are lots of samples on the web, from MSDN to
CodeProject. I'd start by googling for a simple delegate tutorial.

-Chris
 
You could create, and raise an event in the DB class, and have the two
forms declare the db class using the WithEvents keyword, and then update
the UI from an event method
 
That worked great.

Thanks.

Jon said:
You could create, and raise an event in the DB class, and have the two
forms declare the db class using the WithEvents keyword, and then update
the UI from an event method
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top