使用custom control时,如何使自定义控件随它的大小变化而变化?在线等待 这个自定义控件是CWnd继承下来的,我让custom control的变大,但自定义控件并不随着custom control变大,还是原来大小。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 都是星星啊:) 谢谢回答。我在OnScroll中添加if ((m_old_cx) ){ dx = cx * 100 / m_old_cx;dy = cy * 100 / m_old_cy;CRect rectChildSaved;CWnd *pWndChild = GetWindow(GW_CHILD);while(pWndChild){ pWndChild->GetWindowRect(rectChildSaved); ScreenToClient(rectChildSaved); rectChildSaved.left = rectChildSaved.left * dx / 100; rectChildSaved.right = rectChildSaved.right * dx / 100; rectChildSaved.top = rectChildSaved.top * dy / 100; rectChildSaved.bottom = rectChildSaved.bottom * dy / 100; pWndChild->MoveWindow(rectChildSaved); pWndChild = pWndChild->GetNextWindow(); }Invalidate();}m_old_cx = cx;m_old_cy = cy; 抱歉,刚才笔误,是在OnSize函数中 在VS2008中怎么给组合框控件添加初值 非模态对话框产生的问题 如何判断某个窗口是否在最前面? 进程的当前目录 简单问题(dll),高手进 请教大侠:在使用CRichEditView的InsertFileAsObject的时候,对于许多OBJECT都自动显示为图标,请问谁知道如何让系统显示原来的文档? 将socket设置为sock_stream,但为什么不能通信? Win32中怎么存盘数据 500 分求用RAS拨号进行数据传输的资料和代码 急,请教问题! 哪里有图像匹配的源程序?急寻!! 列表框问题3:用API怎样得到选中的那一行的序号?
if ((m_old_cx) )
{
dx = cx * 100 / m_old_cx;
dy = cy * 100 / m_old_cy;
CRect rectChildSaved;
CWnd *pWndChild = GetWindow(GW_CHILD);
while(pWndChild)
{
pWndChild->GetWindowRect(rectChildSaved);
ScreenToClient(rectChildSaved);
rectChildSaved.left = rectChildSaved.left * dx / 100;
rectChildSaved.right = rectChildSaved.right * dx / 100;
rectChildSaved.top = rectChildSaved.top * dy / 100;
rectChildSaved.bottom = rectChildSaved.bottom * dy / 100;
pWndChild->MoveWindow(rectChildSaved);
pWndChild = pWndChild->GetNextWindow();
}Invalidate();
}
m_old_cx = cx;
m_old_cy = cy;