2 Replies - 794 Views - Last Post: 13 May 2010 - 01:26 AM Rate Topic: -----

#1 systemerror   User is offline

  • D.I.C Head

Reputation: -19
  • View blog
  • Posts: 205
  • Joined: 15-August 09

C# Control Other Forms With Out Opening Them

Posted 12 May 2010 - 02:39 AM

Is it possible to Control Other Forms With Out Opening Them? I know the code its

 public partial class Form1 : Form
    {
        //Declare form2 globally
        Form2 seond;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            seond = new Form2();
            seond.Show();  

        }

        private void button2_Click(object sender, EventArgs e)
        {
            seond.textBox1.Text = "Hiii...from form1";  
        }
    }



But I want to know how to control it in real time just like VB 2008, in vb 2008 you can control them easy from the form2 to form1 like

        private void button1_Click(object sender, EventArgs e)
        {
            Form1.textbox1.text = "This is from form2"()
        }


Can anyone help?

Is This A Good Question/Topic? 0
  • +

Replies To: C# Control Other Forms With Out Opening Them

#2 Ändrew   User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 312
  • Joined: 21-April 08

Re: C# Control Other Forms With Out Opening Them

Posted 12 May 2010 - 03:21 AM

Your code above should work.

As so would this.
Form2 frm2 = new Form2();

frm2.Textbox2.Text = "Ha controling it using my mind";



I hope that gives you a insight.

This post has been edited by Ändrew: 12 May 2010 - 03:22 AM

Was This Post Helpful? 0
  • +
  • -

#3 systemerror   User is offline

  • D.I.C Head

Reputation: -19
  • View blog
  • Posts: 205
  • Joined: 15-August 09

Re: C# Control Other Forms With Out Opening Them

Posted 13 May 2010 - 01:26 AM

View PostÄndrew, on 12 May 2010 - 02:21 AM, said:

Your code above should work.

As so would this.
Form2 frm2 = new Form2();

frm2.Textbox2.Text = "Ha controling it using my mind";



I hope that gives you a insight.


I tried that and it doesn't seem to work, nothing happens
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1