vb.net variable passing

Discussion in 'Programming' started by Silver89, Feb 12, 2010.

  1. #1
    Hi,

    I'm creating a program that will have multiple forms and classes. The user progresses from one form to another and data needs to be sent between the forms.

    How can I pass this data between forms without declaring it as a public/global item?

    Or is there a better way to produce such a program?

    Slightly confusing myself :rolleyes:

    Thanks
     
    Silver89, Feb 12, 2010 IP
  2. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
  3. brian65

    brian65 Active Member

    Messages:
    1,172
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    88
    #3
    Assuming you are using VB.Net, each form is simply a class. You can pass a value to a form via the form/ class constructor. By making the constructor require an argument, you ensure the form gets the data it needs.
     
    brian65, Feb 18, 2010 IP