How to call a variable from another form

Hi, I have a problem on calling the variable from another form. I need the value of it for comparision. Do I need to establish a class like C++? Please help, I am a beginner of VB, so I don't know much

Comments

  • : Hi, I have a problem on calling the variable from another form. I need the value of it for comparision. Do I need to establish a class like C++? Please help, I am a beginner of VB, so I don't know much
    :

    [code]FormName.Variable[/code]

    For example:

    [code]Text1.Text = Form1.YourVariable[/code]

    Or

    [/code]Form1.YourVariable = Text1.Text[/code]

  • : : Hi, I have a problem on calling the variable from another form. I need the value of it for comparision. Do I need to establish a class like C++? Please help, I am a beginner of VB, so I don't know much
    : :
    :
    : [code]FormName.Variable[/code]
    :
    : For example:
    :
    : [code]Text1.Text = Form1.YourVariable[/code]
    :
    : Or
    :
    : [code]Form1.YourVariable = Text1.Text[/code]
    :
    :

    Note that "YourVariable" needs to be dimmed Public to be accessible.
  • If you are on form1 and you need the value of..say a text box on form2, you can use:

    value = form2.mytext.value


    : Hi, I have a problem on calling the variable from another form. I need the value of it for comparision. Do I need to establish a class like C++? Please help, I am a beginner of VB, so I don't know much
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories