473,804 Members | 2,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Method Name Expected Error

I'm getting a Method Name Expected error when I try to compile.

The error happens here:

imgImage.Click += new ImageClickEvent Handler(updateC olours("X"));
Can someone tell me what I'm doing wrong?

Thanks,

JJ
Nov 16 '05 #1
3 8966
>Can someone tell me what I'm doing wrong?

You have a method call in the delegate constructor call, where a
simple method name is expected. Have you tried

imgImage.Click += new ImageClickEvent Handler(updateC olours);

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
What if I want to pass an argument with that method?

JJ
"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:uf******** *****@TK2MSFTNG P14.phx.gbl...
Can someone tell me what I'm doing wrong?


You have a method call in the delegate constructor call, where a
simple method name is expected. Have you tried

imgImage.Click += new ImageClickEvent Handler(updateC olours);

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #3
Jeff Johnson <je**********@h otmail.com> wrote:
What if I want to pass an argument with that method?


The arguments will be passed by whatever invokes the delegate. If you
want to give extra information, you have to encapuslate that extra
information somewhere. See the first example in
http://www.yoda.arachsys.com/csharp/...rameters.shtml
for an example of this.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

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

Similar topics

1
5829
by: Andrew Edwards | last post by:
Could someone please tell me what I'm doing wrong? The compiler barks at me whenever I throw (bad_alloc). If I remove this the code compiles just fine. template < class DT, class KF > class BSTree; template < class DT, class KF > class BSTreeNode { private:
6
19280
by: Zenon | last post by:
Folks, I cannot figure out why I am getting an error: Error E2303 EngineX.hpp 19: Type name expected. Here is my code. Can you please help? #ifndef EngineX__hpp #define EngineX__hpp #include<iostream> #include <cstring> #include <cmath>
1
2290
by: TAM | last post by:
Hi, I have a simple JavaScript code that ensures that all the form fields are filled and there is also a function that checks if the email is a valid address. For some reason IE is giving "Object Expected" error on the alert statement. The same code doesn't give an error in NN or Opera or Mozilla or FireFox. Can someone give me a clue as what could be wrong here?
4
10503
by: Vishu | last post by:
I m getting this error "Mehtod name expected" in my following code. protected int GetSelectedIndex(string CID) { DataTable dt = ddlDataSet.Tables; for(int iLoop = 0; iLoop <= dt.Rows.Count - 1; iLoop++) { if(Int32.Parse(CID) == Int32.Parse(dt.Rows("job_id"))) { return iLoop;
4
3154
by: Kiyomi | last post by:
Hello, I am trying to replace my alert message box with a popup page. In my page behind,
1
1750
by: finizaini | last post by:
I'm receiving an "Object Expected" Error (Line:309, Char:0). I'm confused as to what is happening.Also, I can't run this code using other browser such as Fire Fox. Thispage only can view using IE. Is there something that I'm missing? The error is pointing to <textarea name="tairbillno" cols="25" rows="4" wrap="HARD" id="tairbillno" ONKEYDOWN="return checkMaxRow(this, 10)"></textarea> Here is my code below: <HTML> <HEAD>...
3
4723
by: =?Utf-8?B?YW5kcmV3?= | last post by:
I have a web application demo page and a web service. On my machine everything works great. In our test environment the web service is working fine... when I point the demo page on my machine to the test environment web service I get results as expected. The demo page in the test environment which is pointed at the web service in the test environment doesn't work at all... instead I end up with this
2
31778
by: tridirk | last post by:
Hi; I am getting a Objceted Expected Error on my forum site. I can't find what is wrong? Line: Char: Error: Object expected Code:0 the site is My SMF Forum
1
13415
by: Alex Dransfield | last post by:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace FindFactors { class Program {
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10325
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.