www.webdeveloper.com
Results 1 to 5 of 5

Thread: How to pass value from one form to another form in .Net?

  1. #1
    Join Date
    Jul 2013
    Posts
    45

    How to pass value from one form to another form in .Net?

    Hello
    I want to access value of one form on the another form, But i can't do this. So please help and tell me how i pass.

  2. #2
    Join Date
    Sep 2012
    Posts
    720
    I wrote this article in response to an almost overwhelming number of requests on forums on how to pass a variable from a one Windows Form to another. In fact, saying that it is going between one form and another is somewhat of a misnomer because this will work for any type of object not just Forms. This seems to be one area where beginners in C# and VB.NET often get stuck. So, rather than having to repeat myself often in forums I wrote this article so that I could point people at it so that they will have the benefit of a full explanation as well as the answer to their problem.

    The code examples that come with this article are available for VB.NET and C# so that neither group feels left out. If you develop software in any of the other languages available for .NET then you can probably follow on too. The techniques are the same for all .NET languages the only difference should be in the language syntax.

  3. #3
    Join Date
    Jul 2013
    Posts
    45

    pass value one form to another form

    its ok Stive Smith. But i wana to solution of my question because i have need this in my project.

  4. #4
    Join Date
    Jul 2013
    Posts
    104
    if your both the forms are running, then you can use

    form2.TextBox1.Text=form1.TextBox1.Text

    Else you can declare a Public String variable in Form2, on any event,

    dim Obj as new Form2
    Obj.StrVariable=Me.TextBox1.Text
    Obj.Show

    and on Form2 Load,

    Me.TextBox1.Text=StrVariable

  5. #5
    Join Date
    Jul 2013
    Posts
    45
    Thanks Priyanka for your nice information. I can try this.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles