how to pass the value from current form to another form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manmadhan
    New Member
    • Sep 2009
    • 27

    how to pass the value from current form to another form

    hai...
    i'm new for the .net ,so any body help me,
    "how to pass the value from current form to another form"
    plz send me solution for my problem
  • manmadhan
    New Member
    • Sep 2009
    • 27

    #2
    send me your solution

    Comment

    • ssnaik84
      New Member
      • Aug 2009
      • 149

      #3
      if you want to pass value from Form1 to Form2

      in Form1

      Code:
      button1_click(object sender, eventargs e)
      {
      Form2 obj= new Form2();
      obj.DataToPass= "my value";
      obj.show();
      }
      in Form2

      Code:
      private string data;
      public string DataToPass
      {
      get
      {
      return data;
      }
      set
      {
      data= value;
      }
      }

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Sounds like very similar to this post:

        Comment

        • manmadhan
          New Member
          • Sep 2009
          • 27

          #5
          thankzz...... its working.....

          Comment

          Working...