0

This is my working example:

private void authentic_click(object sender, EventArgs e)
{
     formauthentic accessmyauthenticform = new formauthentic();
     accessmyauthenticform.ShowDialog();
} 

Now, how do you pass parameters to this called form, without re-inventing the code that you could of passed to it?

Thanks.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • To all it may concern in answering my question(s). I went the "Communicate between two windows forms in C# (12 answers)" route (The FormCommunication.zip). I ran the C# formcomm program and it took me a will while to catch on to what was going. It was doing communication from form2 to form1. But I wanted communication to go from Form1 to Form2. After understanding what was happening, I got the Form1 to form2 communication to work quite well and transferred the smarts and code over to my program, and now it works awesomely. And now, A big Thanks for all who helped. Thanks. Papa Charlie. – Papa Charlie Apr 22 '21 at 03:40

1 Answers1

1

Usually, you use properties defined in the form to get/set values

private void authentic_click(object sender, EventArgs e)
{
     Formauthentic accessmyauthenticform = new Formauthentic();
     accessmyauthenticform.UserName = "George";
     if(accessmyauthenticform.ShowDialog() == DialogResult.OK )
     {
         string token = accessmyauthenticform.Token;
     }
} 
John Alexiou
  • 28,472
  • 11
  • 77
  • 133