Hopefully I can explain this OK. I have a countdown Timer - A user enters the time, etc and picks if they want to open min size or max size from Radio buttons. Depending on which they choose it will load either Min form or Max form where the time will value entered in the UserControl form will be passed across and start to countdown. Now there were buttons for pause/stop,reset etc on the User Control form. I want these to be instead on the Min/Max forms. I was hoping the easiest way for me to do this would be hide the button on the user control form and then try and wire it up to a button on min/max form so if they were pressed it preform like the button on user control was pressed. However I am getting the error in title - it highlights the statement below in yellow (next statement that will be executed)....
(note - this line of code is in the Min form - I need to declare a new instance of it so i can call the function PauseMinClick (the Pause button on MinForm) _ I am wanting it to call the btnPauseClick function which is in CountdownUserControl).
private CountdownUserControl CU = new CountdownUserControl();
private void PauseMin_Click(object sender, EventArgs e)
{
CU.btnPause_Click(sender, e);
}
and highlights the one in green below (next statement to execute when this thread returns from current function)...
private Min _Min = new Min();
(this is in my CountdownUserControl class - note i need an instance of it here to pass across the values which have to countdown. Does anyone know what i should be doing to resolve this easily? Ideally I dont want to have to re-write lots of code - I would just like to get it working with the buttons on the new forms Max/Min but wired up as if they were being pressed on the UserControl form (where they all work fine).
Many Thanks - Colly