Triggering a button click through code

前端 未结 6 522
暖寄归人
暖寄归人 2021-01-11 15:18

So I have the following code for when the \"Add player\" button is clicked

private void addPlayerBtn_Click_1(object sender, EventArgs e)
{
    //Do some code         


        
6条回答
  •  不思量自难忘°
    2021-01-11 15:40

    When you call a function, you provide actual arguments, which are values, not formal arguments, which are types and parameter names.

    Change

    addPlayerBtn_Click_1(object sender, EventArgs e);
    

    to

    addPlayerBtn_Click_1(addPlayerBtn, EventArgs.Empty);
    

提交回复
热议问题