Pictrue控件调整大小

1.

RECT lp,rp;
 this->GetParent()->GetWindowRect(&rp);
 this->GetWindowRect(&lp);
 lp.left = lp.left - rp.left;
 lp.top  = lp.top - rp.top;
 lp.right = lp.left+image->GetWidth();
 lp.bottom = lp.top+image->GetHeight();

 

2.

void CLeftView2::OnSize(UINT nType, int cx, int cy)
{
 CFormView::OnSize(nType, cx, cy);

 // TODO: 在此处添加消息处理程序代码
 if(m_Tree.m_hWnd != NULL)
 {
 RECT rect;
 GetClientRect(&rect);
    m_Tree.SetWindowPos(&wndTop,0,0,rect.right,rect.bottom,SWP_SHOWWINDOW);
 }
}

posted @ 2012-12-06 15:29  废弃账号  阅读(116)  评论(0)    收藏  举报