First of all, I in the login window, in A.C PP, is to generate the child window
M_conditionDlg. Create (IDD_DIALOG2, this);
M_conditionDlg. ShowWindow (SW_HIDE);
M_conditionDlg - is to generate the child window of association class
And then through the pictures, the tree structure on the left, and click "condition of the single" to display this window, through the ShowWindow (SW_SHOW); To display
Figure 1
If (strItem=="condition of the single")
{
M_nCurMenu=10;
CRect rt, rr.
GetClientRect (& amp; Rt);
Int h=rt. Height ();
GetDlgItem (IDC_STATIC_gg) - & gt; GetWindowRect (rr);
The ScreenToClient (& amp; The rr);
P_rt=rt;
P_rr=rr.
Rt. Top=rt. Top + 5; Rt. Bottom=h - 3; Rt. Left=rr. Right + 10;
M_conditionDlg. MoveWindow (rt);
M_conditionDlg. ShowWindow (SW_SHOW);
//MessageBox (" conditions of single test ");
}
This window can be generated operations, no problem,
But I through the "conditions" button below the biggest PP generated on the "order" window above, clicking the "order" button, just to produce the condition of single window,
(or by A.C PP
M_conditionDlg. Create (IDD_DIALOG2, this);
M_conditionDlg. ShowWindow (SW_HIDE);
Two other code generation window to display its)
Figure 2
Through the code below shows
CfClientApp * app=(CfClientApp *) AfxGetApp ();//this function can get the current application process of pointer
M_mainDlg=(CMainDlg *) app - & gt; M_pMainWnd;
M_mainDlg - & gt; OpenConditionWindow ();//show the conditions of single window
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the function name: OpenConditionWindow
* can work: according to conditions of single window
No
* and number:* time: on February 8, 2018 15:00:11
* to write: YX
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Void CMainDlg: : OpenConditionWindow ()
{
//p_rt. Top=p_rt. Top + 5;//p_rt. Bottom=h - 3;//rt. Left=rr. Right + 10;
//m_conditionDlg MoveWindow (p_rt);
//m_conditionDlg. Create (IDD_DIALOG2, this);
CRect rt.
GetClientRect (& amp; Rt);
Rt. Left +=530;
M_conditionDlg. MoveWindow (rt);
M_conditionDlg. ShowWindow (SW_SHOW);
}
But this display "condition of the single" window appears in figure 2, the window with another window appears overlap, and "conditions of single window" can't do anything, the mouse drag on, will give "condition of the single" window to brush,
So could you please tell me what's the problem? How can I write to after clicking the "order" button, can show operation "conditions of single window?"
CodePudding user response:
Estimation is the parent window must have been this all,The previous m_conditionDlg. Create (IDD_DIALOG2, this); Don't
If (strItem=="condition of the single")
{
.
//display created before
If (m_conditionDlg m_hWnd==NULL)
M_conditionDlg. Create (IDD_DIALOG2, this);
M_conditionDlg. MoveWindow (rt);
M_conditionDlg. ShowWindow (SW_SHOW);
.
}
CodePudding user response: