This is how to add a new control.
public class Form1
{
private UserControl1 userControl;
public Form1()
{
InitializeComponent();
userControl = new UserControl1();
this.Controls.Add(userControl);
}
}
Mi idea is.
1.On the UserControl1.cs create a 2 propertys one for 'toolStrimpButton1' and another for 'toolStripButton2'.
2.On the Form2.cs create a property for the RitchTextBox.
3.
On Form1.cs create a new instance of UserControl1 and add it to the form(as showed above).
Subscribe to the click event of each UserContro1's buttons(e.i ToolStripButton1.Click += new EventHnadler(ShowForm2)) and implement the handler
If you want information about 'event' see these links(both links belong to one article but these are the topics you nedd for solving your problem).
http://www.codeproject.com/KB/cs/eve...registration20
http://www.codeproject.com/KB/cs/eve...ndlingMethod23
Thanks,
Camilo
Last edited by camilojvarona; Jul 11th, 2008 at 7:23 am.
Reputation Points: 10
Solved Threads: 10
Junior Poster in Training
Offline 89 posts
since Jul 2008