wxPanel全屏显示
一. wxFrame 全屏很方便直接使用方法 ShowFullScreen(true)
二. wxPanel 的wxWindows* parent 对象是wxFrame,要实现全屏,this指wxFrame;mPanel 指wxPanel; 先全屏wxFrame,在设置wxPanel为全屏尺寸。若wxFrame有无关控件可使用Hide()隐藏。
方法一:获取屏幕的分辨率
int nScreenWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, NULL);
int nScreenHeight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, NULL);
this->SetSize(wxSize(nScreenWidth, nScreenHeight));
this->Move(wxPoint(0,0));
mPanel->SetSize(this->GetSize());
this->Move(wxPoint(0,0));
方法二:
注明: 此种方法只能全屏成功一次,第二次不能全屏不知什么原因
this->ShowFullScreen(true);
mPanel->SetSize(this->GetSize());
this->Move(wxPoint(0,0));