I am working with multiple forms in C#.
My startup Form /or/ Parent Form /or/ Form1 is a login form.
on my Form1, I have a textbox1 for username and textbox2 for password and a buttons for submit and cancel.
on click event of submit button,if textbox1.text && textbox2.text are correct, it will show the Form2 and hide the Form1.
on my Form2 I have a delete button.
once delete button is clicked, it will show the Form1 and hide Form2 to enter the username and password again for security of the record before deleting.
Note: I know how to do the above issue, my problem is the issue below this line:
I want to resume the delete method I created once username and password entered in Form1 are correct.
AND do nothing but go back to Form2 if neither is correct OR if Form1 is closed OR if cancel button is hit.
How do I do the checking of username and password again in Form1 to be able to delete the record?
Could it be something like this:
if (Form1.textbox1.text == "mySetUsername" && Form1.textbox2.text == "mySetPassword")
{
resume my delete method
}
else
{
cancel event args
or something like form2.show (); form1.Hide();
}
Please show the possible codes or events. Thank you!