程序刚运行时,我的对话框总会在屏幕的左上角闪一下,然后才显示在屏幕的中间点位置。但是我的对话框初始化时没有对对话框的位置做任何改变?这是为什么?请大家帮我解决一下,谢谢先。

解决方案 »

  1.   

    oh,你难道重新创建一个新的dialog也这样?
    不会吧
      

  2.   

    BOOL CPostmanageDlg::OnInitDialog()
    {
    CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range.
    ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
    ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE);
    if (pSysMenu != NULL)
    {
    CString strAboutMenu;
    strAboutMenu.LoadString(IDS_ABOUTBOX);
    if (!strAboutMenu.IsEmpty())
    {
    pSysMenu->AppendMenu(MF_SEPARATOR);
    pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
    }
    } // Set the icon for this dialog.  The framework does this automatically
    //  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE); // Set big icon
    SetIcon(m_hIcon, FALSE); // Set small icon

    // TODO: Add extra initialization here
    ............
    return TRUE;  // return TRUE  unless you set the focus to a control
    }
    省略号那就是只添加了一些控件的初始化