开发者

pass parameters in a system void - visual c++

how can I pass other parameters in this void?

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e)

I tried adding this parameters:

private: System::Void button1_Click(System::Object^  sender, System::EventArg开发者_运维技巧s^  e,  MySqlDataAdapter ^data, DataSet ^dataset)

but the compiler gives me:

Error 1 error C3352: 'void loadprocedura::Form1::button1_Click(System::Object ^,System::EventArgs ^,MySql::Data::MySqlClient::MySqlDataAdapter ^,System::Data::DataSet ^)' : the specified function does not match the delegate type 'void (System::Object ^,System::EventArgs ^)'

then I tried adding here that parameters, but doesn't work

this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);

I'm a beginner in visual c++ ;)


button1->Click accepts a certain kind of delegate:

void (System::Object ^,System::EventArgs ^)

If you want to trigger the event manually, you can just add parameters to the System::EventArgs object.

You should read a tutorial about C# events:

MSDN Events Tutorial

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜