showing a control from within an other project

Snip

Member
Joined
Feb 17, 2006
Messages
11
Programming Experience
3-5
I have 2 projects interacting. A Windows Application and a Class Library.
I now want to show a ProgressBar on a window from the windows application from within the class library.

The progressbar should appear above a picturebox, so I take the picturebox as a parameter in the procedure. In this way pb.location, pb.parent and pb.size should be al the info I need...

So I use pb.Parent.Controls.Add(ProgressBar) and than pb.show()

But the progressbar does not seem to be drawn.:confused:

Anybody has any Idea on how this could be solved?
 
Turn it around:
1) Add public event to your class in the class library
2) Fire the event from within your class in the class library whenever needed.
3) Let the client (your Windows Form) handle the UI stuff: just add an event handler and update the UI from within the event handler.

If your class in then class library executes from another thread, you'll have to take some measures to prevent threading issues.
 
Back
Top