| 发表于:2007-02-27 08:35:336楼 得分:10 |
偶终于懂你的意思了 方法如下:(已经过测试) bool cxxxxview::precreatewindow(createstruct& cs) { // todo: modify the window class or styles here by modifying // the createstruct cs //不要在ondraw里绘制背景色,因为这样会使图像在刷新时闪烁 cview::precreatewindow(cs); wndclass wndclass; ::getclassinfo(afxgetinstancehandle(),cs.lpszclass,&wndclass); wndclass.lpszclassname= "newviewname "; wndclass.hbrbackground=createsolidbrush(rgb(128,128,128)); verify(afxregisterclass(&wndclass)); cs.lpszclass=wndclass.lpszclassname; return true; // return cview::precreatewindow(cs); } | | |
|