ok i'm working in visual studio.
im working on an application with multiple forms, and im trying to access controls in form1, from the form2 class. Heres what im using now:
public partial class Form2 : Form
{
private Button btn1;
public Form2(Button _btn1)
{
InitializeComponent();
btn1 = _btn1;
}
public void SomeEvent()
{
btn1.Text = "";
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void SomeEvent()
{
Form2 newform = new Form2(button1);
newform.Show();
}
}
just an example.
i was wondering if there was another way to do this (if i wanted to pass more than one controls) rather than passing each control like the one above?