|
-
April 9th, 2012, 09:19 AM
#1
Using 'sender' in switch statement
Is there any way in which an attribute of 'sender' in an event can be used in a 'switch' header'.
I find that I can use 'sender' like this :- if (sender == Pentagon) OK but if I try to use 'sender' like this I get an error :- ' switch (sender)'. What I am wanting to do is something like this :-
private void ShapeMenu_Click(object sender, EventArgs e)
{
switch (sender)
case Pentagon:
break;
case Hexagon:
break
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|