Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4104190
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:05:13+00:00 2026-05-20T21:05:13+00:00

I am attempting to carry the value of a single textbox into another textbox

  • 0

I am attempting to carry the value of a single textbox into another textbox on another form.

In form 1 i have the following code:

private SecondForm secondForm;
public void SecondFormTextBox()
{
    uname.Text = secondForm.uname.Text;
}

In form 2 I have the following code.

public TextBox uname
{
    get
    {
        return uname;
    }
}

I recieve the following errors, hope you can help!!

An object reference is required for
the non-static field, method, or
property
‘WindowsFormsApplication1.AdministratorHome.uname.get’

Ambiguity between
‘WindowsFormsApplication1.AdministratorHome.uname’
and
‘WindowsFormsApplication1.AdministratorHome.uname’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:05:13+00:00Added an answer on May 20, 2026 at 9:05 pm

    Lets do an exampe with passing a value from textBox on form1 on button press, to a textBox on form2.
    Code:

    //form1:
    Form2 form2;
    
    private void button1_Click()
    {
       if(form2 == null)
       {
           form2 = new Form2();
           form2.Show(); 
       }
       form2.PassToForm2(textBox1.Text);
    }
    
    //form2:
    private void PassToForm2(string msg)
    {
       textBox1.Text = msg;
    }
    

    Hope it helps,
    Mitja

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to generics-ify some legacy code, I'm stuck. I have a ParentObject which wraps
Attempting something like public string MyText { get {return lbl.Text;} set {lbl.Text = value;}}
Attempting to compile the following code under Qt SDK 4.7.4 for Desktop - MinGW
I am attempting to do some statistics-related functions so I can carry out a
Attempting to build a C# NPAPI plugin I have found a tutorial which describes
Attempting to get Spring internationalization working. I have used classpath:messages basename, created .properties files
Attempting to use XStream's JavaBeanConverter and running into an issue. Most likely I'm missng
Attempting/struggling to get registration and sign-up working within an active admin project. I have
I ran into some strange behavior when attempting to simplify the creation of a
Attempting to database driven website for video rentals So I have two tables in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.