Re: Timer not working in thread
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Fri, 4 Apr 2008 14:54:55 +0100
<sony.m.2007@xxxxxxxxxxxxxx> wrote:
<snip>
when I tried
this.Invoke((MethodInvoker) delegate {timer1.Enabled =
false;label1.visible =false});
I'm getting copiler errors
1. A namespace does not directly contain members such as fields or
methods
2.Invalid expression term ')'
3.Invalid expression term 'delegate'
4.Invalid token '=' in class, struct, or interface member declaration
5.Type expected
6.Type or namespace definition, or end-of-file expected
Well for a start you'd need an extra semi-colon after
label1.visible=false (as well as making it use real properties -
*please* start posting the actual code).
Then there's the question of whether you're using C# 3 to start with...
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
.
- Follow-Ups:
- Re: Timer not working in thread
- From: Marc Gravell
- Re: Timer not working in thread
- References:
- Timer not working in thread
- From: sony . m . 2007
- Re: Timer not working in thread
- From: Marc Gravell
- Re: Timer not working in thread
- From: Marc Gravell
- Re: Timer not working in thread
- From: sony . m . 2007
- Timer not working in thread
- Prev by Date: Re: Timer not working in thread
- Next by Date: Re: Timer not working in thread
- Previous by thread: Re: Timer not working in thread
- Next by thread: Re: Timer not working in thread
- Index(es):
Relevant Pages
|
Loading