Re: How to keep a Dialog's width and height in a solid ratio
- From: "William" <port@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 22 May 2007 11:00:16 +0900
Thanks Seetharam.
But I only can do it by handling CDlg1::WindowProc(UINT message, WPARAM
wParam, LPARAM lParam) with message == WM_SIZING.
If I try CDlg1::OnSizing(UINT fwSide, LPRECT pRect), it doesn't go there at
all when I re-size the dialog. I just don't know what is wrong. I did as
follows,
class CDlg1 : public CDialog
{
protected:
//{{AFX_MSG(CDlg1)
virtual BOOL OnInitDialog();
afx_msg void OnSizing( UINT nSide, LPRECT lpRect );
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
void CDlg1::OnSizing(UINT fwSide, LPRECT pRect)
{
CDialog::OnSizing(fwSide, pRect);
pRect->bottom = pRect->top + (pRect->right - pRect->left) * 3 / 4;
}
If you set a breakpointer at the line of "pRect->bottom = pRect->top +
(pRect->right - pRect->left) * 3 / 4;"
it doesn't go in here.
William
void CDlg1::OnSizing(UINT fwSide, LPRECT pRect)
{
CDialog::OnSizing(fwSide, pRect);
// check for the fwSide you want.. assuming bottom right..
pRect->bottom = pRect->top + 0.75 * (pRect->right - pRect->left) ;
}
-Seetharam Misro
.
- References:
- How to keep a Dialog's width and height in a solid ratio
- From: William
- Re: How to keep a Dialog's width and height in a solid ratio
- From: MrAsm
- Re: How to keep a Dialog's width and height in a solid ratio
- From: Seetharam
- How to keep a Dialog's width and height in a solid ratio
- Prev by Date: Can I uninstall/reinstall Microsoft .NET framework 2.0?
- Next by Date: Re: Seeing VERSIONINFO under Vista?
- Previous by thread: Re: How to keep a Dialog's width and height in a solid ratio
- Next by thread: CHtmlView document.returnValue
- Index(es):
Relevant Pages
|