我使用一个ceditview,初始化时窗口中没有滚动条,后面根据用户数据的大小进行调整。
tmp->ModifyStyle(0,WS_VSCROLL);
((CMainFrame*)tmp->GetOwner())->RecalcLayout(true);
可是滚动条并不立刻出现,而是在点一下菜单,或是工具条这后才出现。
tmp->ModifyStyle(0,WS_VSCROLL);
((CMainFrame*)tmp->GetOwner())->RecalcLayout(true);
可是滚动条并不立刻出现,而是在点一下菜单,或是工具条这后才出现。
tmp->UpdateWindow();
((CMainFrame*)tmp->GetOwner())->UpdateWindow();
((CMainFrame*)tmp->GetOwner())->RecalcLayout(true);
tmp=NULL;怪啊,我更新了所有相关的窗口都不行啊!
肯定可以。
以前我用过。
当时我是在view中放置了一棵树。
强制重绘所有窗体
tmp->UpdateWindow();
((CMainFrame*)tmp->GetOwner())->UpdateWindow();
((CMainFrame*)tmp->GetOwner())->RecalcLayout(true);
tmp=NULL;
你这段代码加到哪里了?
因此可以在需要重绘时添加如下代码:
CRect rClient;
GetClientRect(&rClient);
ClientToScreen(&rClient);
MoveWindow(&rClient);
这样虽然窗体仍在原来的位置,却强行进行重绘