User Controls (I am new to win forms dev)

  • Thread starter Thread starter Ruslan Shlain
  • Start date Start date
R

Ruslan Shlain

Hello Everyone,
I have a solution that consists of two projects. The Win user control
library and win forms project. The purpose of the windows forms project is
to be a container for everything that goes on the user control. My question
is if I have a win form and I drag and drop user control on it and I have a
button on that user control on click of which I have to show another win
form from the Windows form project that will hold different user control.
And also how do I pass values back and forth between the forms.

This architecture is mandated to me.

Thanks
 
That architecture is fine.

Basically, you have two forms A and B, that contain one control each A1 and
B1.

This would require that when you click the button inside A1 that you raise
an event to A. A would create a new instance of B (and hence B1). A would
then pass the data to B, B would pass the data to B1.

To pass data back and forth you can define your own custom Delegates that
accept the correct data types you want to pass or implement a simple
EventHandler delegate, then in the handler of the event call a method or
property on the class.

This post, will help explain:
http://groups.google.com/groups?q=CustomClickHandler&ie=UTF-8&oe=UTF-8&hl=en


HTH;
Eric Cadwell
http://www.origincontrols.com
 
Back
Top