Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用Timer.tick事件处理程序发送2个整数参数_C#_Timer_Event Handling_Arguments - Fatal编程技术网

C# 如何使用Timer.tick事件处理程序发送2个整数参数

C# 如何使用Timer.tick事件处理程序发送2个整数参数,c#,timer,event-handling,arguments,C#,Timer,Event Handling,Arguments,我有一个带有Timer.tick事件的构造函数 public PlayMe(int rows, int cols) { this.rows = rows; this.cols = cols; delay = new Timer(); delay.Enabled = false; delay.Interval = 550; delay.Tick += delay_Tick; restart = new Timer(); resta

我有一个带有Timer.tick事件的构造函数

public PlayMe(int rows, int cols)
{
    this.rows = rows;
    this.cols = cols;

    delay = new Timer();
    delay.Enabled = false;
    delay.Interval = 550;
    delay.Tick += delay_Tick;

    restart = new Timer();
    restart.Enabled = false;
    restart.Interval = 550;
    restart.Tick += restart_Tick(rows,cols);
如何在Timer.Tick方法中激发row和cols参数

void restart_Tick(int rows, int cols)
{
    restart.Stop();

    if (gameOver && lblLose.Visible)
    {
        clearBoard();
        createBoard(rows,cols);
    }

    if (gameOver && lblWin.Visible)
    {

        for (int i = 0; i < 5; i++)
        {
            clearBoard();
void restart\u勾选(整数行、整数列)
{
restart.Stop();
if(gameOver&&lblLose.Visible)
{
透明板();
createBoard(行、列);
}
如果(gameOver&&lblWin.Visible)
{
对于(int i=0;i<5;i++)
{
透明板();
重写:

restart.Tick += (object s, EventArgs a) => restart_Tick(s, a, rows, cols);
方法是:

  void restart_Tick(object sender, EventArgs e,int rows, int cols)