如何在c#Error'System Windows Forms KeyEventArgs'

时间:2016-01-28 03:18:53

标签: c# winforms events user-controls

如何在c#Error'System Windows Forms KeyEventArgs'

中创建keydown事件

错误:

  

'System.Windows.Forms.KeyEventArgs'不包含带0参数的构造函数?如何创建keydown事件   EXP>>> [![在此输入图像说明] [1]] [1]

public event KeyEventHandler TextBoxKeyDow;

protected void OnTextBoxKeyDow()
{
    if (TextBoxKeyDow != null)
    {
        TextBoxKeyDow(this,new KeyEventArgs());
    }
} 

1 个答案:

答案 0 :(得分:-1)

public event EventHandler BBBClick;
    protected void OnBBBClick()
    {
        if (BBBClick != null)
        {
            BBBClick(this, new EventArgs());
        }
    }   
    private void button1_Click_1(object sender, EventArgs e)
    {
        OnBBBClick();
    }

在用户控件中创建keydown事件 EXP>>> Required image is displayed