-
passing data
Hello everyone,
I have a quick question. I have a console application that displays a form to retrieve some information. How can I use data from the console application in the displayed form?????
Ex. I have a console app that has insurance information. I need a phone number to be entered for the insurance information. I created a form to be used as an input box. I display the form to retrieve the information, but I also want to display the insurance companies name on the form. How can I retrieve that information from the console part of the program??????
Thanks in advance,
Kendal
-
The correct OOP way would be creating a public property on the form that takes a string. If it's set, it sets the forms Text ( or anything else on the form ).
-
Thanks nvoigt,
That did the trick on that one. So simple yet I missed it. I have another question about retrieving variables in somewhat the same manner. If I have start out with one instance of a class and create an instance of another class, how can I access a value that was set in the top level class. That would seem somewhat like a parent-child architecture, but from what I have seem, parent-child architecture is only used with forms. I am trying to do this in some console programming. Thanks for all of your help.
Thanks,
Kendal
-
Well, that somewhat depends on your own architecture. You can set a Parent variable in the child and give the this pointer of the parent as parameter when constructing the child. Or any other way you see fit :)