i mean, progress bar in vb .net..thankz
In theory the action that is taking a long time should be in its own thread. That way it doesn't hang up the entire program.
Part of that long-time method should include raising an event.
The event should have event arguments stating what its current status or progress is. Maybe those arguments are percent complete. Maybe its time remaining. Maybe its number of records. That's for you to work out based on the function.
Your progress bar should subscribe to those events.
When the long-time process raises an event, the progress bar 'hears" the event and reacts by updating, based on the arguments.
This keeps your program response 'snappy', your long term function isolated from your progress bar, and your progress bar isolated from the long term function.
Of course you probably want to give the progress bar function enough smarts to time-out after xx minutes etc.