passing data

This is a discussion on passing data within the C# Programming forums, part of the General Programming Boards category; Hello everyone, I have a quick question. I have a console application that displays a form to retrieve some information. ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    184

    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

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    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 ).
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    184
    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

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    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
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 03:27 AM
  2. data structure design for data aggregation
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 05-20-2008, 07:43 AM
  3. Data member passing
    By wirefree101 in forum C++ Programming
    Replies: 7
    Last Post: 12-18-2006, 01:41 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  5. Passing structure data to a function?
    By diddy02 in forum C Programming
    Replies: 8
    Last Post: 08-17-2002, 05:15 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21