Passing datas from one form to anotther in C#.net
-
Hai I have two forms opened in my mdiparent form I want to pass the value from textbox of 1st form to textbox of the 2nd form I cannot create a new instance of the 2nd form since I want to send to the same opened instance, I tried by changing the property to public but cannot be acessed with out creating a new instace pls help me to pass the values to the same opened instance of the form
Thanks & Regards
-
Hai I have two forms opened in my mdiparent form I want to pass the value from textbox of 1st form to textbox of the 2nd form I cannot create a new instance of the 2nd form since I want to send to the same opened instance, I tried by changing the property to public but cannot be acessed with out creating a new instace pls help me to pass the values to the same opened instance of the form
Thanks & Regards
declare a variable as static ..........if this doenst works take a class declare static variables in it assing the values to the stat variable while u r in first form then use them in next form.......................please dont mind ...make u r question clear regards sindhu tiwari
its me sid
-
declare a variable as static ..........if this doenst works take a class declare static variables in it assing the values to the stat variable while u r in first form then use them in next form.......................please dont mind ...make u r question clear regards sindhu tiwari
its me sid
sindhutiwari wrote:
declare a variable as static
What if there is more than one instance of the form class?
sindhutiwari wrote:
make u r question clear
What about your answer. For the most part it was a clear as mud.
Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * The Value of Smaller Methods * Creating Many-to-Many joins My website | blog
-
Hai I have two forms opened in my mdiparent form I want to pass the value from textbox of 1st form to textbox of the 2nd form I cannot create a new instance of the 2nd form since I want to send to the same opened instance, I tried by changing the property to public but cannot be acessed with out creating a new instace pls help me to pass the values to the same opened instance of the form
Thanks & Regards
This article on passing values between forms[^] might help you.
Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * The Value of Smaller Methods * Creating Many-to-Many joins My website | blog
-
Hai I have two forms opened in my mdiparent form I want to pass the value from textbox of 1st form to textbox of the 2nd form I cannot create a new instance of the 2nd form since I want to send to the same opened instance, I tried by changing the property to public but cannot be acessed with out creating a new instace pls help me to pass the values to the same opened instance of the form
Thanks & Regards
Don't try passing values between forms. A neater architectural approach, is to abstract the data model from the actual visual representation of the value. One way to do this is to implement something called the Model View Controller[^] pattern.
Deja View - the feeling that you've seen this post before.
-
Hai I have two forms opened in my mdiparent form I want to pass the value from textbox of 1st form to textbox of the 2nd form I cannot create a new instance of the 2nd form since I want to send to the same opened instance, I tried by changing the property to public but cannot be acessed with out creating a new instace pls help me to pass the values to the same opened instance of the form
Thanks & Regards
have a public variable in mdi window, once you open the child forms, in the form load assign the control to mdi public variables instead of access the form2 text box , access the mdi variable. regards Elayaraja.S