S
Steve N.
I am trying to add a 'Validating' event handler to a TrackBar.
Code:
...
this->tbKeyboards->Validating += new System::EventHandler(this,
tbKeyboards_Validating);
...
System::Void tbKeyboards_Validating(Object* sender,
System::ComponentModel::CancelEventArgs* e)
...
Compiling this code results in the following error: "void
kbKeyboards_Validating(System::Object __gc
*,System::ComponentModel::CancelEventArgs __gc *)' : the specified
function does not match the delegate type 'void (System::Object __gc
*,System::EventArgs __gc *)"
So I change the 'System::ComponentModel::CancelEventArgs' to
'System::EventArgs' in order to fix it. (It doesn't seem to make sense
because what is the use of a Validating event if there is no
cancelEventArgs?) Anyway, changing it gives me this error:
"'System::Windows::Forms::Control::add_Validating' : cannot convert
parameter 1 from 'System::EventHandler __gc *' to
'System::ComponentModel::CancelEventHandler __gc *'"
So what's wrong?
Thanks.
Code:
...
this->tbKeyboards->Validating += new System::EventHandler(this,
tbKeyboards_Validating);
...
System::Void tbKeyboards_Validating(Object* sender,
System::ComponentModel::CancelEventArgs* e)
...
Compiling this code results in the following error: "void
kbKeyboards_Validating(System::Object __gc
*,System::ComponentModel::CancelEventArgs __gc *)' : the specified
function does not match the delegate type 'void (System::Object __gc
*,System::EventArgs __gc *)"
So I change the 'System::ComponentModel::CancelEventArgs' to
'System::EventArgs' in order to fix it. (It doesn't seem to make sense
because what is the use of a Validating event if there is no
cancelEventArgs?) Anyway, changing it gives me this error:
"'System::Windows::Forms::Control::add_Validating' : cannot convert
parameter 1 from 'System::EventHandler __gc *' to
'System::ComponentModel::CancelEventHandler __gc *'"
So what's wrong?
Thanks.