急!!!使用Easysize ,当dialog边框滑动时,界面闪烁的问题

cewu6780 2017-07-20 05:19:00
老弟按照网络上使用Easysize 的方法,可以进行图标随着边框变化。但是这时画面闪烁很厉害,求大神分析
...全文
229 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2017-07-24
  • 打赏
  • 举报
回复
WPF ?
schlafenhamster 2017-07-24
  • 打赏
  • 举报
回复

void CDlg1::OnSize(UINT nType, int cx, int cy) 
{
	CBaseDialog::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
    if(IsWindow(m_Dlg1Sta1))// also m_Dlg1Edit1
	{// when dlg1 moves.
		CRect rcs;
		CRect rce;
		m_Dlg1Sta1.GetWindowRect(&rcs);
		m_Dlg1Edit1.GetWindowRect(&rce);
	// You will defer all the application's windows.
		HDWP hdwp = BeginDeferWindowPos(2);
	// First, "Please Input :"
		DeferWindowPos(hdwp, m_Dlg1Sta1, NULL,
			(cx-rcs.Width()-rce.Width())/2,(cy-rcs.Height())/2-20, 
			rcs.Width(), rcs.Height(),
			SWP_NOZORDER);
	// Next, Cedit.
		DeferWindowPos(hdwp,m_Dlg1Edit1, NULL,
			(cx-rcs.Width()-rce.Width())/2+rcs.Width()+2,(cy-rce.Height())/2-20,
			rce.Width(), rce.Height(),
			SWP_NOZORDER);
	// redraw all the windows
		EndDeferWindowPos(hdwp);
	}
}
cewu6780 2017-07-24
  • 打赏
  • 举报
回复
引用 5 楼 zhao4zhong1 的回复:
WPF ?
这个是MFC里面的
cewu6780 2017-07-21
  • 打赏
  • 举报
回复
这个是我上传的源代码:http://download.csdn.net/detail/cewu6780/9906059 以下是可能的解决方法: AliRafiee's solution leaves "dirt" when user moves borders back and forth during resizing, and does not eliminate flickering on tabs. My solution is to also put UPDATE_EASYSIZE in the OnExitSizeMove handler and to use a Boolean flag, say m_bSizing_es, that's set to FALSE in the OnInitDialog handler, set to TRUE in the OnSizing handler, and set to FALSE in the OnExitSizeMove handler. In the OnSize handler, condition UPDATE_EASYSIZE like so: if (m_bSizing_es) UPDATE_EASYSIZE;. These could be incorporated into the macros. Logic here is to postpose UPDATE_EASYSIZE until user finishes resizing, but to still trigger UPDATE_EASYSIZE when the dialog is maximized.
cewu6780 2017-07-21
  • 打赏
  • 举报
回复
引用 1 楼 schlafenhamster 的回复:
不用Easysize
有什么好的提议吗
zgl7903 2017-07-20
  • 打赏
  • 举报
回复
schlafenhamster 2017-07-20
  • 打赏
  • 举报
回复
不用Easysize

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧