i have a form created using Visual Basic 2008 in c#
i want to add a button that when clicked, it will check multiple fields which if contains text then paste it into other text boxes if they are empty
this is the code i currently have, but its not working
private void btnCopytoBAN_Click(object sender, EventArgs e)
{
if (BAddress.Text.Length < 0)
{BAddress.Text = MAddress.Text;}
else
if (BCity.Text.Length < 0)
{BCity.Text = MCity.Text;}
else
if (BState.Text.Length < 0)
{BState.Text = MState.Text;}
else
if (BZIP.Text.Length < 0)
{BZIP.Text = MZIP.Text;}
else
if (BEmail.Text.Length < 0)
{BEmail.Text = MEmail.Text;}
else
if (BName.Text.Length < 0)
{BName.Text = MFName.Text + " " + MLName.Text;}
else
if (TEmail.Text.Length < 0)
{TEmail.Text = MEmail.Text;}
else
if (TName.Text.Length < 0)
{TName.Text = MFName.Text + " " + MLName.Text;}
else
if (MWork.Text.Length < 0)
if (MWork.Text.Length > 0)
{BPhone.Text = MWork.Text;
TPhone.Text = MWork.Text; ;
}
else if (MMobile.Text.Length > 0)
{BPhone.Text = MMobile.Text;
TPhone.Text = MMobile.Text; ;}
else if (MHome.Text.Length > 0)
{BPhone.Text = MHome.Text;
TPhone.Text = MHome.Text; ;}
}
thanks everyone for their help, this is the code i am now using which works perfect.