R
Robert Crago
Hi there,
I am using an enum in a switch statement as follows:
switch (tabControl1.selectedIndex)
{
case TabPage.SETUPTAB:
...
break;
... etc
}
enum TabPage: int {SETUPTAB, RUNTAB}
But the compiler keeps telling me:
"Cannot implicitly convert type TabPage to int"
I can get around it by using (int)TabPage.SETUPTAB in the
case. But I shouldn't have to (or should I?)
What am I doing wrong?
Thanks,
Robert
I am using an enum in a switch statement as follows:
switch (tabControl1.selectedIndex)
{
case TabPage.SETUPTAB:
...
break;
... etc
}
enum TabPage: int {SETUPTAB, RUNTAB}
But the compiler keeps telling me:
"Cannot implicitly convert type TabPage to int"
I can get around it by using (int)TabPage.SETUPTAB in the
case. But I shouldn't have to (or should I?)
What am I doing wrong?
Thanks,
Robert