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. simple question...

simple question...

Scheduled Pinned Locked Moved C#
questionhelptutoriallearning
2 Posts 2 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.
  • G Offline
    G Offline
    gonad
    wrote on last edited by
    #1

    sorry to be so lame with this question, but i'm still learning how this works. how can i get the input from a user in a textbox control on one form to display on another form? //Form 1 private void data() { Mainform.sdgform sdg = new Mainform.sdgform(); MessageBox.Show(sdg.txtShipTo.Text); } //Form 2 public System.Windows.Forms.TextBox txtShipTo; public void textboxexample() //for example { this.txtShipTo.Text = "example data"; } I have a whole form with a lot of textboxes that a user fills in and i need this data to write to a text file. the problem for me is that the toolbar button (on form 1) generates the 'write to textfile' code but it doesn't see the users input (from form 2). i know it's a lame-o question, but i'm still very new. Thanks for your help.

    N 1 Reply Last reply
    0
    • G gonad

      sorry to be so lame with this question, but i'm still learning how this works. how can i get the input from a user in a textbox control on one form to display on another form? //Form 1 private void data() { Mainform.sdgform sdg = new Mainform.sdgform(); MessageBox.Show(sdg.txtShipTo.Text); } //Form 2 public System.Windows.Forms.TextBox txtShipTo; public void textboxexample() //for example { this.txtShipTo.Text = "example data"; } I have a whole form with a lot of textboxes that a user fills in and i need this data to write to a text file. the problem for me is that the toolbar button (on form 1) generates the 'write to textfile' code but it doesn't see the users input (from form 2). i know it's a lame-o question, but i'm still very new. Thanks for your help.

      N Offline
      N Offline
      Nick Seng
      wrote on last edited by
      #2

      One way would be to make your textboxes public, that way the other form can "see" it.


      Support Bone

      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