case statements within event handlers

This is a discussion on case statements within event handlers within the C++ Programming forums, part of the General Programming Boards category; Hi,
i need some urgent help. I have created a simple windows app- the idea is that there are 5 ...

case statements within event handlers

Hi,

i need some urgent help. I have created a simple windows app- the idea is that there are 5 lights that are all of to begin with, and then turn on as you click the Next button, one after the other (as in, they go from black to yellow).
Now, my idea was to use a variable, state, that has values 0-5- with each click increasing the value of state by 1. I then plan to use a case step causing the visual changes to happen depending on the value of state.

here's an exmaple:

switch (state)
{
case '1' : Shape1->Color = clYellow; break;
etc.
}

It's coming back with an "undefined symbol 'Shape1'. I'm a beginner so have no idea what you can and can't use within case statements within event handlers.

You can use case statements. The error message is telling you that Shape1 is not defined, spelling error somewhere? missing declaration? missing header file?

Attach your whole source plus any non standard headers and resource scripts, (enough so I can compile it), if you need more help. If you want to attach more than one file, zip them together and attach the .zip.