|
I think you maybe use Invoke function, because you want to change some controls which is in the main thread.
E.G.
*********
public static void ThreadProc()
{
Thread.Sleep(1000);
base.Invoke(new EventHandler(this.ReallyClick));
}
private void ReallyClick(object sender, EventArgs args)
{
((Button)selectedButtons[1]).Enabled = false;
((Button)selectedButtons[1]).BackgroundImage = null;
selectedButtons.Clear();
}
**********
experiment it
|
|
|
|
|
I think this is the thing I am looking for. But when I try this it says:
Error 1 : Keyword 'base' is not available in a static method
Error 2 : Keyword 'this' is not valid in a static property, static method, or static field initializer
Do you know why?
|
|
|
|
|
make your control a static one, also the function you are passing to the event handler.
public static System.Windows.Forms.Button btnClose;
then, you cannot use "this" inside a static method. instead, make your method static and give it's name without "this.".
eg
<br />
public static void reallyClick()<br />
{<br />
}<br />
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
Because it's still a static method.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
How did you learn to program?
Is it from the internet? a book?
If from internet wut site and if book, wut book?
I'm trying to learn any language like C++ or C# and i dont have any materials and dont know where to get some good sources.
When you first learn your language, was it hard and how long did it take you to start to create simple programs?
I'm sry if this is too many questions but im new here and i want to understand some of the experiences you had.
|
|
|
|
|
Code2326 wrote: How did you learn to program?
From the book that came with the computer and magazines that showed me how to do certain things.
Code2326 wrote: When you first learn your language, was it hard and how long did it take you to start to create simple programs?
One of my first programs was:
10 PRINT "How old are you?"
20 INPUT a
30 IF a < 8 THEN PRINT "You're too young to use this computer!"; GO TO 10
40 PRINT "Okay - You are old enough to use this computer"
I was about 8 or 9 and I didn't want my younger sister to use the computer.
|
|
|
|
|
Colin Angus Mackay wrote: I was about 8 or 9 and I didn't want my younger sister to use the computer.
How long did it take for your sister to catch on and lie about her age?
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
PaulC1972 wrote: How long did it take for your sister to catch on and lie about her age?
As I recall she wasn't even sufficiently interested to type in her age. (She was only about 5 or 6 at the time)
|
|
|
|
|
What computer did you write the BASIC program on?
You will see a delete button on each of your posts. Press it. - Colin Angus Mackay
|
|
|
|
|
A Sinclair ZX Spectrum 48K (Mk 2 - which had a slight overheating problem that means the colours would get skewed when it heated up. I had to adjust a variable resistor on the motherboard sometimes.)
|
|
|
|
|
Colin Angus Mackay wrote: Sinclair ZX Spectrum 48K
That's so cool. Here's what I started off with: http://oldcomputers.net/ts1000.html[^]
--modified
I wish I could find it. I do still have my old Commodore 128 in the attic and have been debating on pulling it out to fiddle around with it
You will see a delete button on each of your posts. Press it. - Colin Angus Mackay
|
|
|
|
|
That's the same one I started with too! 2K of memory and a cassette recorder, who could ask for anything more?
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Yeah, and I remember showing off to all my friends what I could do with the old Sinclair. Upgraded to the Commodore 64/128 and that was cool. Then after that, got a 80386 when they first came out. It had 4 megs of ram and a "vast" 80 meg hard drive
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
You skipped over the 8088/8086/80286? Guess that Commodore was pretty sweet! Never got hold of one, but the graphics we're supposed to be impressive.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Steve Echols wrote: You skipped over the 8088/8086/80286?
Yep. The Commodore wasn't all that bad of a machine for its time. It was a big leap from a 6502 based machine to Intel :-> The junior college I started off at had their Ada compilers on 8088s and it took 2 minutes to compile a typical hello world program. My 386, well, about 5 seconds
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
I can hear my kid now (in 15 years) - "You used a silicon based processor? How'd you ever get anything done?"
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Steve Echols wrote: I can hear my kid now (in 15 years) - "You used a silicon based processor? How'd you ever get anything done?"
No kidding
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
PaulC1972 wrote: still have my old Commodore 128
Hang on to it! I still kick myself for getting rid of my C64. I had 2 (one for parts), a tape drive, a butt load of software (even a very functionable GUI!).
I sold the whole thing at a yard sale for $50!
David Wilkes
|
|
|
|
|
Colin Angus Mackay wrote: 10 PRINT "How old are you?"20 INPUT a30 IF a < 8 THEN PRINT "You're too young to use this computer!"; GO TO 1040 PRINT "Okay - You are old enough to use this computer"
If you had tried this:
10 PRINT "Are you a cute looking girl? sweetie?"
20 INPUT a
30 IF a=true then PRINT "REALLY??"; GOTO 20;
It'd have become a maintanance free application!
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
When we can go out of this loop (never or always)
|
|
|
|
|
when the user turns above 40
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
Code2326 wrote: a book
and a long, long time ago it was. Your best bet is to find a good book ( preferably one that doesn't have "21 days" or "For Dummies" in the title ). This site is a good place to learn from, too. People are pretty helpful with any questions you have, as long as you don't use the words "urgent" or make it sound like your problem is a school assignment problem.
Code2326 wrote: but im new here
Welcome aboard
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
Code2326 wrote: How did you learn to program?
Is it from the internet? a book?
As it was about five years before the web even existed, care to guess?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Welcome Newbie!!!!
Don't worry we are all 'newbies' to something in the world of computers and development.
Code2326 wrote: How did you learn to program?
Trial and Error
Hint: if you keep running into a dead-end get up and walk way for awhile:i.e. hour, day, whatever it takes.
Code2326 wrote: Is it from the internet? a book?
One realy big word "GOOGLE" you can find almost anything or help you need out there on the internet.
Hint: When searching Google, if developing in C# use a search like: "C# OleDBConnection". This will narrow your results down to mostly C# results.
Get a couple of good books sometimes your mind can figure things out better on the 'can' than in front of the computer. I have found some very good -basic- information out of some of those 'learn in 24 hours' or 'are you a dumby' these books not a real good refernce but can show some basics.
And always remmeber CP check the boards and articals--lots and lots of help.
Code2326 wrote: When you first learn your language, was it hard and how long did it take you to start to create simple programs?
Hello World!!! an't she great Everything can be diffucult the first time but the more you do it the more you can learn.
Good Luck,
Jason
Programmer: A biological machine designed to convert caffeine into code. * Developer: A person who develops working systems by writing and using software.
[ ^]
|
|
|
|
|
During the 1970's at a mainframe manufacturers training establishment in London.
COBOL, Assembler and PLAN on these mainframes - CDC6600, IBM360 & ICL1900 Series. All using 80 column coding forms whose contents were transfered to either punched card or paper tape by an external bureaux. And what fun correcting these "typing" errors - each punched card had to be individually checked for correctness else very expensive and wasted time-shared computer time.
modified 1-Aug-19 21:02pm.
|
|
|
|