I have my main form, form1, and my secondary form, form2. When form2 is first launched it has two values that are disabled, however at a later time I want users to be able to enable those values and use them but I can't figure out how to either send a value to the form2 for a test or access the features of form2 in form1.cs (which seems preferable.)
I was thinking something like this:
[code]
public void StartForm2(int passwordType)
{
gbxForm.Enabled = false;//this is meant to be disabled
PasswordForm form2 = new PasswordForm(cb oxName.Text);//passes the users name to the new form
//shows form2
form2.Show();
}
private void lnklblChangePas sword_LinkClick ed(object sender, LinkLabelLinkCl ickedEventArgs e)
{
//ideal, but obviously doesn't work
form2.txtbxOldP assword.Enabled = true;
form2.show();
}
I know the above code doesn't work but it should give an idea of what I'm trying to achieve.
I was thinking something like this:
[code]
public void StartForm2(int passwordType)
{
gbxForm.Enabled = false;//this is meant to be disabled
PasswordForm form2 = new PasswordForm(cb oxName.Text);//passes the users name to the new form
//shows form2
form2.Show();
}
private void lnklblChangePas sword_LinkClick ed(object sender, LinkLabelLinkCl ickedEventArgs e)
{
//ideal, but obviously doesn't work
form2.txtbxOldP assword.Enabled = true;
form2.show();
}
I know the above code doesn't work but it should give an idea of what I'm trying to achieve.
Comment