I need to pass a string value from Form1:
public void button1_Click(object sender, EventArgs e)
{
string DepartmentName = \"IT\";
Form2
There is an easier way to pass the string from Form2 to Form1. Create a relationship between the forms and in Form2, create a variable of Form1, invoke the variable in Form1 and assign the value to it ....
public partial class Form_2 : Form
{
public readonly Form1 _form1;
public Form_2(Form1 form1)
{
_form1 = form1;
InitializeComponent();
}
private void Form2(object sender, EventArgs e)
{
_form1.Remark = txtbx_remark.Text;
}// Remark is a string in Form1 ....