0

Hi !!!

I have two Windows Forms. In First Windows Form i have one Text Box and one Button. In the Second Windows Form i wish to call First Windows Form and get the value of Text Box. Is this is possible? When i create a object of the First Windows Form in Second Windows Form and I try to call property Text of Text Box, every time is Empty.

6
Contributors
7
Replies
14
Views
6 Years
Discussion Span
Last Post by ashishkumar008
-1

Hi,
Use Cookie or session as http.
If you need code for C# or VB write me <EMAIL SNIPPED>

Edited by peter_budo: Keep It Organized - Do not ask anyone (member or moderator) for help by email or PM

0

:) Thank you very much. :) I'll mark this post as Solved !!! Thank you again !!!

0

in form2.cs

public Form2()
        {
            InitializeComponent();
        }
        public Form2(string s)
        {
            InitializeComponent();
            textBox1.Text = s;
        }

in form1.cs

        Form2 f = new Form2(textBox1.Text);
        f.Show();

Edited by mike_2000_17: Fixed formatting

0

marked textbox with public keyword and also use a static variable to store textbox data.
now you can use this textbox and it's data in next or other forms.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.