Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. windows application

windows application

Scheduled Pinned Locked Moved C#
csharptutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    virz
    wrote on last edited by
    #1

    hey can anybody tell me how to pass control values of one window form to other in windows application in c#?????????????????????/ Thanking You. Sincerely, VIRAL PATEL

    _ C 2 Replies Last reply
    0
    • V virz

      hey can anybody tell me how to pass control values of one window form to other in windows application in c#?????????????????????/ Thanking You. Sincerely, VIRAL PATEL

      _ Offline
      _ Offline
      _mubashir
      wrote on last edited by
      #2

      Hello... You can use public variable to which you can pass value...Like suppose if you have two forms Form1 n Form2. Now you want to pass value from Form1 to Form2.....First make a public variable in Form2 then in Form1 use the following code. Form2 obj = new Form2(); obj.yourpublicvariable = "some value"; // assign value to public var of form2 // ur code ................................................ The other way could be that you can pass the value to Form2 via Constructor.like Form2 obj = new Form2("Some Value"); //For this you must write your own constructor in Form2 accepting the value u r passing. Hope this helps regards mubashir

      C 1 Reply Last reply
      0
      • V virz

        hey can anybody tell me how to pass control values of one window form to other in windows application in c#?????????????????????/ Thanking You. Sincerely, VIRAL PATEL

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        You can read this article on passing values between forms[^]


        "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

        1 Reply Last reply
        0
        • _ _mubashir

          Hello... You can use public variable to which you can pass value...Like suppose if you have two forms Form1 n Form2. Now you want to pass value from Form1 to Form2.....First make a public variable in Form2 then in Form1 use the following code. Form2 obj = new Form2(); obj.yourpublicvariable = "some value"; // assign value to public var of form2 // ur code ................................................ The other way could be that you can pass the value to Form2 via Constructor.like Form2 obj = new Form2("Some Value"); //For this you must write your own constructor in Form2 accepting the value u r passing. Hope this helps regards mubashir

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          _mubashir wrote:

          You can use public variable to which you can pass value

          Ugghh! That is a bad idea and here's why[^]


          "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

          _ 1 Reply Last reply
          0
          • C Colin Angus Mackay

            _mubashir wrote:

            You can use public variable to which you can pass value

            Ugghh! That is a bad idea and here's why[^]


            "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

            _ Offline
            _ Offline
            _mubashir
            wrote on last edited by
            #5

            Thanx pal for correcting me... regards mubashir

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups