gavriel ankri

gavriel ankri

  • NA
  • 39
  • 48.6k

how to use event from another class

Apr 22 2011 5:09 PM
hello

I have 2 classes :      ChatServer    and  ClientConnected

I am trying to fire an event from windows form.  usually I am doing like this:


 private void Form1_Load(object sender, EventArgs e)
    {


        cc = new ChatServer();


      cc.FirstMsgEvent += new FirstMsg(cc_firesMsgEvent);

    }


However, in this case my event is on the other class - ClientConnected and I cant do "cc = new ClientConnected".
Is there another way to fire this event from the Form1_Load function ?

thank you !
                             
    

Answers (1)