Results 1 to 6 of 6

Thread: [RESOLVED] [2.0] Pass Data From One Form To Another

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Resolved [RESOLVED] [2.0] Pass Data From One Form To Another

    In VB.NET to pass something from one form to another I would do
    vb.net Code:
    1. 'on Form1
    2. Form2.TextBox1.Text = TextBox1.Text
    How would I do the same thing in C#?

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2.0] Pass Data From One Form To Another

    Ok, in doing some searching on this topic, I discover that in .NET, controls are declared as Friend (in VB) or private (in C#) by default.

    However, I don't know how to use this information to get what I need. Would I create a property or class for this?

  3. #3
    Lively Member Zolomon's Avatar
    Join Date
    Oct 2007
    Location
    Sweden
    Posts
    104

    Re: [2.0] Pass Data From One Form To Another

    This is quite problematic in C# to be honest, and I myself have been looking for this for quite a while.

    I should have an example of it, let me dig it up!

    Edit:

    Here are three ways of doing it.

    I'll see if I can find more.
    Last edited by Zolomon; Dec 18th, 2007 at 10:13 AM.

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2.0] Pass Data From One Form To Another

    Thanks for the link. I just glanced at it, but it looks like just what I'm after. I"m going to go read it all right now.

  5. #5
    Lively Member Zolomon's Avatar
    Join Date
    Oct 2007
    Location
    Sweden
    Posts
    104

    Re: [2.0] Pass Data From One Form To Another

    No problems!

    I had some difficulty with this during the summer but then I found that link and everything went smoothly afterwards. (:

    Cheers,
    Zolomon

  6. #6

    Thread Starter
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2.0] Pass Data From One Form To Another

    Ok, using one of the examples in Zoloman's link, I got it to work.

    Thanks again.

Posting Permissions

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



Click Here to Expand Forum to Full Width