Handle Selected index change

  • Thread starter william_dudek@_yahoo_com
  • Start date
W

william_dudek@_yahoo_com

I am becoming extremely frustrated with the event handlingin C#. I need
to handle the OnSelectedIndex changed event and am getting the
following error message when I build the application.

C:\Documents and Settings\Administrator\My Documents\Visual Studio
Projects\RecipieGuide\FormRecipe.cs(599):
'RecipieGuide.FormRecipie.tabAlphabet_OnSelectedIndexChanged(object,
System.EventArgs)': no suitable method found to override

This is my override functon.
protected override void tabAlphabet_OnSelectedIndexChanged(object
sender, EventArgs e)

And I am adding an event handler with the following code
this.tabAlphabet.SelectedIndexChanged += new System.EventHandler
(this.tabAlphabet_OnSelectedIndexChanged );

If someone could provide and example of what I need to do here, or
explain what I am doing wrong or not doing it would be greatly
appreciated.

Thanks
Bill

P.S. I'm trying to handle this on a tab control if it makes a differance
 
C

Chris R. Timmons

I am becoming extremely frustrated with the event handlingin C#.
I need to handle the OnSelectedIndex changed event and am
getting the following error message when I build the
application.

C:\Documents and Settings\Administrator\My Documents\Visual
Studio Projects\RecipieGuide\FormRecipe.cs(599):
'RecipieGuide.FormRecipie.tabAlphabet_OnSelectedIndexChanged(obje
ct, System.EventArgs)': no suitable method found to override

This is my override functon.
protected override void
tabAlphabet_OnSelectedIndexChanged(object sender, EventArgs e)

And I am adding an event handler with the following code
this.tabAlphabet.SelectedIndexChanged += new
System.EventHandler
(this.tabAlphabet_OnSelectedIndexChanged );

If someone could provide and example of what I need to do here,
or explain what I am doing wrong or not doing it would be
greatly appreciated.

Thanks
Bill

P.S. I'm trying to handle this on a tab control if it makes a
differance

Bill,

Remove the "override" directive from your method.
 
W

william_dudek@_yahoo_com

Thanks that did it. I wonder why VB.Net makes it so easy to do this and
C# makes it so hard, granted there is more flexibility in C#, I don't
see why it can't be easier to do things like this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top