1
Answer

How to pass the form object to this method?

Hi,

I use the MVC (Model View Controller) design pattern for my application. View and the controller classes are in one applicaton and the “View” is in  class library.

 

In the View I have a form “form1” that has a button “btn”

 

In the controller " controller" I have mapped the click event of the “btn” of the “form1” to “btnVirtual” of the "Controller". This assignment and the event handler declaration happens in the constructor of the "controller".

 

In the controller there is another method “send(form1 fmr){ }” that takes  an object of the “form1”. But I need to call the send() from the click event of the btnVirtual. Therefore when I clik on the button “btn” of the form1, fires the click event of the "btnVirtual" button of controller class.

 

How do I call the send() from the click event of the btnVirtual passing an object of form1 as an argument to sent()

 

   private void btnVirtualSearch_Click(object sender, EventArgs e)

   {

            //write code to validate inpout

            //MessageBox.Show("Hello");

 

            this.searchAMovie(frm); //How do I pass this frm object?

   }

 

cheers

Answers (1)