怪异:组合框不能正常显示的问题。
最近在一个工程的时候,用到了一个组合框资源,组合框的大小托得足够大的。最初我在我15英寸液晶显示器上显示完全正常,但拿到19英寸上去的适应,为了适应屏幕大小(整个对话框占满真个屏幕),所以考虑更加屏幕大小自适应调整对话框上资源的尺寸。在对话框的OnSizezhon其主要代码如下:
CRect rectChildSaved;
//get the control on the reason property page
CWnd *pWndChild = GetWindow(GW_CHILD);
while(pWndChild)
{
//get the size of the control when sizing
rectChildSaved = listRect.GetNext(mP);
rectChildSaved.left = rectDlgNow.left + (int)((rectChildSaved.left - rectDlgSaved.left) * fRateScaleX);
rectChildSaved.top = rectDlgNow.top + (int)((rectChildSaved.top - rectDlgSaved.top) * fRateScaleY);
rectChildSaved.right = rectDlgNow.right + (int)(rectChildSaved.right - rectDlgSaved.right) * fRateScaleX);
rectChildSaved.bottom = rectDlgNow.bottom + (int)
rectChildSaved.bottom - rectDlgSaved.bottom)
* fRateScaleY);
//coordinate transform
ScreenToClient(rectChildSaved);
//change to the new position
pWndChild->MoveWindow(rectChildSaved);
//change the font size of the control
pWndChild->SetFont(pCFont);
//for the next control
pWndChild = pWndChild->GetNextWindow();
}
这样一样,原本可以正常下拉的Combo box 拉不下来了。感觉就像Combo box的高度设置不够一样。
请问大侠:我错在那里啊,该咱办呢?
谢谢!