The passed object doesnt have the member that i need, how to fix this?

Mar 26 2009 12:59 AM

Hi,

I have a form "frmAddMovies" that has a button control "btn1". I have controller class "controller", i need to capture the click event occurs on "btn1" of "frmAddMovies " from the "Controller" class.

public class Controller
{

        public Button btnVirtual;

        public Controller(frmAddMovies form)
        {
            btnVirtual = form.btn1 //"btn1" doesnt display in the intellisense therefore risen an error.
    
    //later i need to add this event handler but without correcting the above live it's not possible
    btn1.click += new EventHandler(btn1_Click);
        }
}


public class frmAddMovies : Form
{
    ....................
    ....................
    ....................
}

How can i make the "form" object display the "btn1" in it's intellisense?


cheers


Answers (1)