Update FOrm textboxs from a seperate class
I have a Form - Form1, which contains several textboxs all with private accesibility.
i also have a class - Populate, from which i want to be able to modify the textbox.text values on form1 when i call into it.
i have tried various methods but nothing seems to give me what i want.
what is the best way to allow my code to modify textbox.text values WITHOUT compromising the integrity of my original form ? i dont want to expose the textboxs with public accessibility.
I am calling the method in the populate class from within a ' comboBox1_SelectedIndexChanged ' method which passes over 2 parameters - namely a XMLdocument and a string.
This method will eventually return a new string but i need to be able to say form1.textbox1.text = "blah blah" in this method and i cant access the textboxs.
any ideas please. im sure i have done something before where i passed the form to the method but i cant get that to work either and thought there must be another way of exposing the textboxs anyway.
just an after thought - if i instantiate a class at the start of the class ( i.e. form1) rather than within the method i need to access it from (ie comboBox1_SelectedIndexChanged) is there any substantial memory or security issues here ? i understand that fgrom the start of the class it will be available to all methods with the class but does this haver a major impact?