Click here to Skip to main content
15,892,575 members
Home / Discussions / C#
   

C#

 
GeneralRe: Simple calculator [modified] Pin
nstk14-Feb-11 10:21
nstk14-Feb-11 10:21 
AnswerRe: Simple calculator Pin
RichardGrimmer15-Feb-11 3:58
RichardGrimmer15-Feb-11 3:58 
Questionerror in timer function Pin
aeman12-Feb-11 4:40
aeman12-Feb-11 4:40 
AnswerRe: error in timer function Pin
Manfred Rudolf Bihy12-Feb-11 5:10
professionalManfred Rudolf Bihy12-Feb-11 5:10 
GeneralRe: error in timer function Pin
aeman12-Feb-11 6:25
aeman12-Feb-11 6:25 
AnswerRe: error in timer function Pin
OriginalGriff12-Feb-11 5:20
mveOriginalGriff12-Feb-11 5:20 
GeneralRe: error in timer function Pin
aeman12-Feb-11 20:07
aeman12-Feb-11 20:07 
AnswerRe: error in timer function Pin
OriginalGriff12-Feb-11 21:34
mveOriginalGriff12-Feb-11 21:34 
Look at your error messages:
Error	1	Invalid expression term ')'	C:\Documents and Settings\XPPRESP3\My Documents\Visual Studio 2005\Projects\WindowsApplication2\WindowsApplication2\Form1.cs	30	41	WindowsApplication2


Error	1

This means it is an Error, not a Warning: compilation cannot continue. It is error number "1" or however many the compiler will find.
Invalid expression term ')'	

This tells you what the compiler does not like: in this case it was not expecting a ")" here
C:\Documents and Settings\XPPRESP3\My Documents\Visual Studio 2005\Projects\WindowsApplication2\WindowsApplication2\Form1.cs	

The file that has the error.
30	

The line number in the file that the compiler is complaining about
41	

The column of the line that the error was noticed in.
WindowsApplication2

The Project that the problem was found in.

Now, with all that, can you work out what you should do next?

Right: Find the line. It is line 30: Use CTRL+G to go to line 30.

button1.Invoke(new Action(() => button1.BackColor=Color.Green));

Look at column 41.
button1.Invoke(new Action(() => button1.BackColor=Color.Green));
                           ^
                           |

What does the compiler expect there?
Some kind of expression, given that it is inside a "("...")" pair.
And so on. I am not going to sit here and explain in great detail every nuance of every compiler error: you have to do something yourself! Laugh | :laugh:

In this case, ditch the Invoke. Replace the line with:
button1.BackColor=Color.Green;

Then provide a matching handler routine for your greenTimer...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."

AnswerRe: error in timer function Pin
Henry Minute12-Feb-11 6:07
Henry Minute12-Feb-11 6:07 
AnswerRe: error in timer function Pin
Luc Pattyn12-Feb-11 6:14
sitebuilderLuc Pattyn12-Feb-11 6:14 
GeneralRe: error in timer function Pin
Henry Minute12-Feb-11 6:34
Henry Minute12-Feb-11 6:34 
GeneralRe: error in timer function Pin
Luc Pattyn12-Feb-11 6:42
sitebuilderLuc Pattyn12-Feb-11 6:42 
AnswerRe: error in timer function Pin
_Erik_14-Feb-11 3:42
_Erik_14-Feb-11 3:42 
Questioncapture finger print continuously Pin
s_akram12-Feb-11 3:12
s_akram12-Feb-11 3:12 
AnswerRe: capture finger print continuously Pin
Henry Minute12-Feb-11 3:20
Henry Minute12-Feb-11 3:20 
Questioncapture finger print continuously Pin
s_akram12-Feb-11 3:09
s_akram12-Feb-11 3:09 
AnswerRe: capture finger print continuously Pin
Dave Kreskowiak12-Feb-11 3:56
mveDave Kreskowiak12-Feb-11 3:56 
QuestionCould not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Marat Beiner12-Feb-11 2:34
Marat Beiner12-Feb-11 2:34 
AnswerRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 3:21
Henry Minute12-Feb-11 3:21 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Marat Beiner12-Feb-11 6:20
Marat Beiner12-Feb-11 6:20 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 6:32
Henry Minute12-Feb-11 6:32 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT [modified] Pin
Marat Beiner12-Feb-11 8:32
Marat Beiner12-Feb-11 8:32 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 8:58
Henry Minute12-Feb-11 8:58 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Marat Beiner12-Feb-11 9:10
Marat Beiner12-Feb-11 9:10 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 9:59
Henry Minute12-Feb-11 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.