In my application I need a progress bar to display the progress of a plant growing. This would be the code:

```
    private static Timer farmProgress;
    internal void initFarmProgTimer( int step, int max = 100 )
    {
        farmProgress = new Timer();
        farmProgress.Tick += new EventHandler(farmProgress_Tick);
        farmProgress.Interval = step; // in miliseconds
        farmProgress.Start();

    }
    private void farmProgress_Tick(object sender, EventArgs e)
    {
        if (increment >= 100)
        {
            // wait till user get plant
        }
        else
        {
            increment++;
            plantProgressBar.Value = increment;
        }
    }

```

Here the call of the `initFarmProgTimer` function:

```
    public static System.Threading.Timer growTimer;
    public static void InitGrowTimer(int time, string name)
    {
        growTimer = new System.Threading.Timer(growTimer_Finished, null, time, Timeout.Infinite);
        plantActive = true;

        Menu menu = new Menu();
        menu.initFarmProgTimer(time / 100);
    }

```

Note that the class where this function is called from is NOT a form but the class where the function is defined IS a form.

Does anybody know what my error is?

**edit**
here is the call for the InitGrowTimer function

```
    switch ( index )
        {
            case 0:
                currentPlant = wheat.name;
                plantQ = printPlantDatas("wheat");
                if (plantQ == true)
                {
                    InitGrowTimer(wheat.time, wheat.name);
                    wheat.planted++;
                }
                break;
        }

```