这是我的代码。
void Form1::dessin(int choice){
switch(choice){
case 0:
Form1::BackColor = System::Drawing::systemcolors::activeBorder;
break;
case 1:
Color MyColor = Color.FromArgb(255,0);
Form1::BackColor = MyColor;
break;
case 5:
this->Ofck->Text = "textbruh";
break;
}
}
这个简单的代码我收到4个错误:
Error 3 error C2228: left of '.FromArgb' must have class/struct/union c:\Users\gabas\documents\visual studio 2010\Projects\Iwannatrain\Iwannatrain\Iwannatrain.cpp 27 1 Iwannatrain
Error 2 error C2275: 'System::Drawing::Color' : illegal use of this type as an expression c:\Users\gabas\documents\visual studio 2010\Projects\Iwannatrain\Iwannatrain\Iwannatrain.cpp 27 1 Iwannatrain
Error 4 error C2360: initialization of 'MyColor' is skipped by 'case' label c:\Users\gabas\documents\visual studio 2010\Projects\Iwannatrain\Iwannatrain\Iwannatrain.cpp 30 1 Iwannatrain
Warning 1 warning C4832: token '.' is illegal after UDT 'System::Drawing::Color' c:\Users\gabas\documents\visual studio 2010\Projects\Iwannatrain\Iwannatrain\Iwannatrain.cpp 27 1 Iwannatrain
我知道这可能是一个新手问题,但是我真的无法解决这个错误。