Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

TrackBar 'Validating' Event Hander doesn't match Delegate?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve N. - 30 Mar 2005 16:55 GMT
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.
Steve N. - 30 Mar 2005 17:00 GMT
It would probably help if I posted the function code (oops):

// First Way
private: System::Void tbKeyboards_Validating(Object* sender,
System::ComponentModel::CancelEventArgs* e) { }

// Second Way
private: System::Void tbKeyboards_Validating(Object* sender,
System::EventArgs* e) { }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.