I want to have a function in a user control to:
1. initialize/show the user control
2. calculate the function value based on user inputs, and
3. terminate the user control and pass the value to the main program from where the usercontrol.function is called.

How is this possible?