1、propetysheet 能不能先不addpage即空的先显示出来。
我这里有个需求需要先获得数据然后再addpage,所以 希望空的sheet先显示出来。代码是 在oninitialdlg中请求数据,等获得数据后就addpage.  sheet是DoModal形式的。
2、有个按钮需要放到窗体的正中间偏下,纵坐标已经定下,不用改。大致代码如下,但是效果不能在窗体横坐标的正当中在oninitialdlg中
GetWindowRect( &rt1 ) ;//窗体相对屏幕位置
m_btn.GetWindowRect( &rt2  );//按钮相对屏幕位置int offset = ( r2.width()-r1.width() )/2;rt2.left -= offset;  rt2.right -= offset;ScreenToClient( &rt2 );m_btn.MoveWindow( &rt2 );

解决方案 »

  1.   

    1.
    It is not necessary to wait until creation of the property sheet window to call AddPage. Typically, you will call AddPage before calling DoModal or Create. If you call AddPage after displaying the property page, the tab row will reflect the newly added page. 2. 
    OnInitDialog()函数中
    CRect rect;
    GetClientRect(&rect); CRect rc;
    m_btn.GetClientRect(&rc);

    #define MAX_Y_GAP 20
    int nWidth = rc.Width();
    int nHeight = rc.Height();
    rc.left = (rect.Width() - nWidth) / 2;
    rc.right = rc.left + nWidth;
    rc.top = rect.bottom - nHeight - MAX_Y_GAP;
    rc.bottom = rc.top + nHeight; m_btn.MoveWindow(rc);
      

  2.   

    VisualEleven
    1、我没看明白
    2、代码是错的 m_btn.GetClientRect(&rc);是按钮的坐标系  GetClientRect(&rect);是窗口的坐标系
    实际试验也是错的