ahmed sa

ahmed sa

  • NA
  • 289
  • 129.4k

clear variable value of edit employee after pass the value

Jul 24 2014 2:40 PM

My proplem is when i open employee form the value of editemployee value still found after i close the form

class as below this pass data from windows form edit employee to form employee

in first form(edit employee) i write in edit button after update statment success the following code

Fleet.EditEmployee = textBox1.Text;


Employee frm = new Employee(value1, value2, value3, value4);

frm.Show();


this.Close();


And in second form(employee form) i write the following code in load event :

label24.Text = Fleet.EditEmployee;



if (label24.Text != "")

{

button7.Enabled = false;

button5.Enabled = false;

}

else

{

button7.Enabled = true;

button5.Enabled = true;

}

and this is my class

class fleet

{

static string EditEmployee

{


get

{


return EditEmployeeNo;

}


set

{

EditEmployeeNo = value;

}

}

when i open form employee again the variable edit employee that represent label24 value still exist

how to clear value of label24 without exit the program

Meaning i need from program when i open employee form again label24 is clear value that have

if possible help me

thanks


Answers (2)