7,540
社区成员
发帖
与我相关
我的任务
分享
id=this->GetDlgCtrl();
swith(id)
{
case IDC_BUTTON1;
id=IDC_BUTTON3;//then id turn inton IDC_BUTTON3, which get the input fucus!
dc.FillSolidRect(&rect,RGB(255,0,0)); //IDC_BUTTON3 fill the red color!
sprintf(str,"状态%d");
dc.DrawText(str,strlen(str+7),&rect,DT_CENTER|DT_VCENTER);
break;
case IDC_BUTTON2;
id=IDC_BUTTON3;//then id turn inton IDC_BUTTON3, which get the input fucus!
dc.FillSolidRect(&rect,RGB(0,255,0));
sprintf(str,"状态%d");
dc.DrawText(str,strlen(str+7),&rect,DT_CENTER|DT_VCENTER);
break;
}
id==this->GetDlgCtrl();
if(id=IDC_BUTTON1)
{
id=IDC_BUTTON3;
}
if(id=IDC_BUTTON2)
{
id=IDC_BUTTION3;
}
swith(id)
{
case IDC_BUTTON1;//then id turn inton IDC_BUTTON3, which get the input fucus!
dc.FillSolidRect(&rect,RGB(255,0,0)); //IDC_BUTTON3 fill the red color!
sprintf(str,"状态%d");
dc.DrawText(str,strlen(str+7),&rect,DT_CENTER|DT_VCENTER);
break;
case IDC_BUTTON2;//then id turn inton IDC_BUTTON3, which get the input fucus!
dc.FillSolidRect(&rect,RGB(0,255,0));
sprintf(str,"状态%d");
dc.DrawText(str,strlen(str+7),&rect,DT_CENTER|DT_VCENTER);
break;
}
if(id==IDC_BUTTON1)
{
flag=true;
id=IDC_BUTTON3;
}
if(id==IDC_BUTTON2)
{ flag=false;
id=IDC_BUTTON3;
}