Q:

button.visible = true unexpected error

I'm working on a project in which i have a timer.  When the timer is over I'm doing some instructions and I'm setting visibility of a button to true. 
This line result to an error 
"Invalid parameter" in Program.cs at line
Application. Run(new Main());

I have no idea how a simple change on the visibility of a button can cause an error here. 
Here is the code : 
private void timerDuring_Tick(object sender, EventArgs e)
{
    if (timeLeft > 0)
    {
        timeLeft = timeLeft - 1;
        labelTime. Text = timeLeft +"";
    }
    else
    {   
        TimerDuring. Stop();
        labelTime. Visible = false;
        VCapture. Dispose();
        VCapture = null;

        capture. Dispose();

        CamImageBox. Visible = false;

        String pathVideo = Path. Combine(Environment. GetFolderPath(Environment. SpecialFolder. MyDocuments), "video.avi");
        WMP.Visible = true;
        WMP.URL = pathVideo;   //Emplacement de la video apres la capture
        WMP.uiMode = "none";
        WMP.settings.setMode("loop", true);
        WMP.Ctlcontrols.play();   // chaque image a recup

        btnDecoupe. Visible = true; // ERROR caused  HERE
        btnReplay. Visible = true;  // ERROR caused  HERE
   }   
}

And the Program.cs where the error is indicated by Visual Studio:
static class Program
{
    /// <summary>
    /// Point d'entrée principal de l'application. 
    /// </summary>
    [STAThread]
    static void Main()
    {
        Application. EnableVisualStyles();
        Application. SetCompatibleTextRenderingDefault(false);
        Application. Run(new Main());
    }
}

When I change Visibility to false it works, error is thrown only when I change it to true. 
The name of my form is "Main.cs"

A:

You should only be manipulating controls on the UI thread.  You can do that by calling Control. Invoke():
Invoke(new Action(() =>
    {
        btnDecoupe. Visible = true;
        btnReplay. Visible = true;
    }));

Do the same for setting them to false.  Any time you want to change something about a control in a different thread, such as in a timer event.