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. VB6 TO C#

VB6 TO C#

Scheduled Pinned Locked Moved C#
csharptutorialquestion
4 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.
  • M Offline
    M Offline
    M Riaz Bashir
    wrote on last edited by
    #1

    Hi All Respected Programmers VB6 Method => Form2.Text1.Text = Form1.Text1.Text Kindly guide me, how may I use said method in C# ? Thank you very much in Advance :)

    I C 2 Replies Last reply
    0
    • M M Riaz Bashir

      Hi All Respected Programmers VB6 Method => Form2.Text1.Text = Form1.Text1.Text Kindly guide me, how may I use said method in C# ? Thank you very much in Advance :)

      I Offline
      I Offline
      iprasad007
      wrote on last edited by
      #2

      You need to create objects of both the forms and then u can use same code just by adding semicolon after it, such as Form1 x=new Form1(); Form2 y=new Form2(); x.Text1.Text=y.Text1.Text;

      1 Reply Last reply
      0
      • M M Riaz Bashir

        Hi All Respected Programmers VB6 Method => Form2.Text1.Text = Form1.Text1.Text Kindly guide me, how may I use said method in C# ? Thank you very much in Advance :)

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        The advice you were given is sort of right. If you create new instances of Form1 and Form2, they will not relate in any way to instances that are in use in your app, so the call will do nothing, you need to use the instances that are in use, I assume you're in form1, and you want to call form2, in which case, you need the instance name for the Form2 instance, and drom Form1 entirely from the code snippet. Your text box controls are also probably private, and instance of changing that, you should add properties that set the text of the textbox to the controls. Also, I assume these are not your actual variable names ?

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        I 1 Reply Last reply
        0
        • C Christian Graus

          The advice you were given is sort of right. If you create new instances of Form1 and Form2, they will not relate in any way to instances that are in use in your app, so the call will do nothing, you need to use the instances that are in use, I assume you're in form1, and you want to call form2, in which case, you need the instance name for the Form2 instance, and drom Form1 entirely from the code snippet. Your text box controls are also probably private, and instance of changing that, you should add properties that set the text of the textbox to the controls. Also, I assume these are not your actual variable names ?

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

          I Offline
          I Offline
          iprasad007
          wrote on last edited by
          #4

          very true ...

          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