473,383 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

delegate error

Hello,

I have a listener class which deals with events .

There I have a function:
private void tChart1_Click(object
sender,System.Windows.Forms.MouseEventArgs e)
{
System.Console.WriteLine("aaa");
System.Console.WriteLine(this.line3.CalcXPos(1));
}
This function suppose to be activated by:
this.tChart1.ClickSeries+=new
Steema.TeeChart.TChart.SeriesEventHandler(tChart1_ Click);

But I ger an error:
CS0123: Method 'WindowsApplication2.EventListener.tChart1_Click(o bject,
System.Windows.Forms.MouseEventArgs)' does not match delegate 'void
Steema.TeeChart.TChart.SeriesEventHandler(object,
Steema.TeeChart.Styles.Series, int, System.Windows.Forms.MouseEventArgs)'

The delagate I have is:
public delegate void ChangedEventHandler(object sender, EventArgs e);

Why do I get the error?
Thanks a lot!
Nov 16 '05 #1
3 1444
Hi Juli,

This line:
this.tChart1.ClickSeries+=new
Steema.TeeChart.TChart.SeriesEventHandler(tChart1_ Click);

says when the "ClickSeries" event gets raise by the tChart1 object
execute the tChart1_Click method. The problem is that the compiler is
telling you that the delegate for a
Steema.TeeChart.TChart.SeriesEventHandler is declared like this:

'void Steema.TeeChart.TChart.SeriesEventHandler(object,
Steema.TeeChart.Styles.Series, int,
System.Windows.Forms.MouseEventArgs)'

which is quite different to the signature of the method you are trying
to wire up to that event. You need to change your tChart1_Click method
to look like this:

private void tChart1_Click(object, Steema.TeeChart.Styles.Series, int,
System.Windows.Forms.MouseEventArgs)
Hope that helps,
James Fitzsimons

Nov 16 '05 #2
"juli" <ji****@gmail.com> wrote in message
news:1f**************************@posting.google.c om...
Hello,

I have a listener class which deals with events .
Why do I get the error?
Thanks a lot!


Another suggestion would be the following (using a .net winform application
with a TeeChart for .Net object on the form and a bar series added at
designtime):

this.bar1.Click += new
System.Windows.Forms.MouseEventHandler(this.bar1_C lick);

private void Form1_Load(object sender, System.EventArgs e) {
bar1.FillSampleValues();

}

private void bar1_Click(object sender, System.Windows.Forms.MouseEventArgs
e) {
System.Diagnostics.Debug.WriteLine("aaa");
System.Diagnostics.Debug.WriteLine(e.X.ToString()) ;
}

this needn't be coded manually as you can click on the bar series object
within the winform designer, choose events and double-click on the Click
event.

Best regards,

Christopher Ireland
Programmer
http://support.steema.com


Nov 16 '05 #3


It did,thank you!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Werth | last post by:
I am trying to use reflection to add an event handler for the RowUpdated event of the OracleDataAdapter object (ODP.NET), but the same thing can be said for SqlDataAdapter if you only use...
3
by: Eugene Mayevski | last post by:
Hello, I am trying to declare in C++ and use in C# a delegate which contains "ref" and "out" parameters. I declare a delegate as: public __delegate void SolFSCreateFileEvent(SolFSStorage*...
2
by: Daniel Brown | last post by:
I am registering a managed delegate to an unmanaged DLL for asynchronous callback. I understand the garbage collector will free the managed resource if they go out of scope but with the...
1
by: CJ Taylor | last post by:
Alright, I probably wont be able to get this question answered, but maybe someone has even more experience than me with delegates... Wow... that sounded fecisious. =) So, I'm trying to...
1
by: Kerry Jenkins | last post by:
I am having problems passing an Event Delegate as an argument to a method that accepts a delegate argument. I get the following error message: 'Public Event ProgressChanged(sender As Object, e...
2
by: shengmin.ruan | last post by:
when i use delegate like this: ----------------- protected override void WndProc(ref Message m) { delegate_ReplyFromDataProcess = new...
6
by: David Veeneman | last post by:
I have several events that pass a value in their event args. One event passes an int, another a string, another a DateTime, and so on. Rather than creating a separate set of event args for each...
1
by: Quimbly | last post by:
I'm having some problems comparing delegates. In all sample projects I create, I can't get the problem to occur, but there is definitely a problem with my production code. I can't give all the...
3
by: Peter Duniho | last post by:
I was reminded in a recent post (http://groups.google.com/group/microsoft.public.dotnet.framework/msg/e649e992db857691?dmode=source) that in C# one can use anonymous delegates without...
1
by: mesut | last post by:
Hi colleagues, In fact I don't have a problem but just don't know which way is good and better. I need some advice which programming way I shall use. Since a couple of days I'm investing my...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.