这个改如何去改 直接忽略 也能运行出来,好奇怪。
代码如下:
btn_stop1_ = dynamic_cast<ui::Button*>(FindControl(L"btn_stop1"));
btn_stop1_->AttachClick(nbase::Bind(&ViewForm::OnClicked, this, std::placeholders::_1));
btn_stop2_ = dynamic_cast<ui::Button*>(FindControl(L"btn_stop2"));
btn_stop2_->AttachClick(nbase::Bind(&ViewForm::OnClicked, this, std::placeholders::_1));
btn_stop3_ = dynamic_cast<ui::Button*>(FindControl(L"btn_stop3"));
btn_stop3_->AttachClick(nbase::Bind(&ViewForm::OnClicked, this, std::placeholders::_1));
phone1_ = dynamic_cast<ui::Label*>(FindControl(L"phone1"));
phone2_ = dynamic_cast<ui::Label*>(FindControl(L"phone2"));
phone3_ = dynamic_cast<ui::Label*>(FindControl(L"phone3"));
```和
bool ViewForm::OnClicked(ui::EventArgs* msg)
{
std::wstring name = msg->pSender->GetName();
if (name == L"btn_stop1")
{
btn_stop1_->SetVisible(false);
phone1_->SetVisible(false);
}
else if (name == L"btn_stop2")
{
btn_stop2_->SetVisible(false);
phone2_->SetVisible(false);
}
else if(name == L"btn_stop3")
{
btn_stop3_->SetVisible(false);
phone3_->SetVisible(false);
return true;
}
}