0

Hi guys.


All in FORM1

public partial class Form1 : Form
    {  
Thread thread;

public Form1()
        {
thread = new Thread(run);
            thread.Start();   
        }
public void run()
        {
          ConectadoThread socketConectado = new ConectadoThread(); 
        }
private void Form1_FormClosing(object sender, FormClosingEventArgs e)

        {    

            socketConectado.close();

        }

 }

Why when i do "socketConectado.close()" it shows me:

Error 2 The name 'socketConectado' does not exist in the current context C:\Users\Mauri\Desktop\Proyectos\Visual Studio 2008\Projects\WindowsFormsApplication3\WindowsFormsApplication3\Form1.cs

Thanks =)

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by __avd
0
public partial class Form1 : Form
    {  
      Thread thread;
      public Form1()
        {
            thread = new Thread(run);
            thread.Start();   
        }
      ConectadoThread socketConectado;
      public void run()
        {
            socketConectado = new ConectadoThread(); 
        }
      private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {    
            socketConectado.close();
        }
 }
This topic has been dead for over six months. 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.