VB6 TO C#
-
Hi All Respected Programmers VB6 Method => Form2.Text1.Text = Form1.Text1.Text Kindly guide me, how may I use said method in C# ? Thank you very much in Advance :)
-
Hi All Respected Programmers VB6 Method => Form2.Text1.Text = Form1.Text1.Text Kindly guide me, how may I use said method in C# ? Thank you very much in Advance :)
You need to create objects of both the forms and then u can use same code just by adding semicolon after it, such as Form1 x=new Form1(); Form2 y=new Form2(); x.Text1.Text=y.Text1.Text;
-
Hi All Respected Programmers VB6 Method => Form2.Text1.Text = Form1.Text1.Text Kindly guide me, how may I use said method in C# ? Thank you very much in Advance :)
The advice you were given is sort of right. If you create new instances of Form1 and Form2, they will not relate in any way to instances that are in use in your app, so the call will do nothing, you need to use the instances that are in use, I assume you're in form1, and you want to call form2, in which case, you need the instance name for the Form2 instance, and drom Form1 entirely from the code snippet. Your text box controls are also probably private, and instance of changing that, you should add properties that set the text of the textbox to the controls. Also, I assume these are not your actual variable names ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
The advice you were given is sort of right. If you create new instances of Form1 and Form2, they will not relate in any way to instances that are in use in your app, so the call will do nothing, you need to use the instances that are in use, I assume you're in form1, and you want to call form2, in which case, you need the instance name for the Form2 instance, and drom Form1 entirely from the code snippet. Your text box controls are also probably private, and instance of changing that, you should add properties that set the text of the textbox to the controls. Also, I assume these are not your actual variable names ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
very true ...