Home > Software engineering >  MFC single document application problem of multiple dialog box display order
MFC single document application problem of multiple dialog box display order

Time:09-30

My single document program will at some point, click on more than the pop-up dialog box, each dialog box has a different function, how to control the display order of these dialog?

, for example, when I use the mouse to click on A dialog box, A at the top, is also the most outside all dialog box, and when I click B dialog, at this point B to switch to the top of the dialog,

I now, a dialog box has been on the top floor, like order unchanged,

Thank you very much!

CodePudding user response:

Use a modal dialog box

CodePudding user response:

reference 1st floor SWWLLX response:
use a modal dialog box


Hello

I now use the dialog is modal dialog box, is this a few of the modal dialog box display order has a problem, not by clicking on the dialog to the top

CodePudding user response:

Use the SetWindowPos?

CodePudding user response:

 
Void CColorTakeDlg: : OnOptionsStayontop ()
{
//TODO: Add your command handler code here
BTopMost ^=TRUE;
If (bTopMost)
: : SetWindowPos (m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
The else
: : SetWindowPos (m_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
ToggleMenuItem (0, 1);
}

CodePudding user response:

 
Void CZorderView: : OnReverseOrder ()
{
Int jj;
if(! CMyWnd: : m_ReverseOrder)
{//1 st reverse
For (jj=MAX_WINS - 1; Jj & gt;=0; Jj -)
{
M_paWnd [jj] - & gt; SetWindowPos (& amp; WndTop, 0,0,0,0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE);
}
}
The else
{//
For (jj=0; Jj & lt; MAX_WINS; Jj++)
{
M_paWnd [jj] - & gt; SetWindowPos (& amp; WndTop, 0,0,0,0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE);
}
}
//tell CMyWnd
CMyWnd: : m_ReverseOrder=!!! CMyWnd: : m_ReverseOrder;
}

CodePudding user response:

SetWindowPos (& amp; WndTop, 0,0,0,0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE )

CodePudding user response:

With a TabCtrl to manage these dialog window

CodePudding user response:

refer to the original poster sjhywsj response:
my single document program will at some point, click on more than the pop-up dialog box, each dialog box has a different function, how to control the display order of these dialog?

, for example, when I use the mouse to click on A dialog box, A at the top, is also the most outside all dialog box, and when I click B dialog, at this point B to switch to the top of the dialog,

I now, a dialog box has been on the top floor, like order unchanged,

Thank you very much!


Modal dialog box is the final show will be at the top, you use a modal dialog box

CodePudding user response:

reference zbzengbing reply: 3/f
use the SetWindowPos?

Hello
No use, I directly use ShowWindow (True). The create before the show

CodePudding user response:

reference 5 floor schlafenhamster reply:
 
Void CZorderView: : OnReverseOrder ()
{
Int jj;
if(! CMyWnd: : m_ReverseOrder)
{//1 st reverse
For (jj=MAX_WINS - 1; Jj & gt;=0; Jj -)
{
M_paWnd [jj] - & gt; SetWindowPos (& amp; WndTop, 0,0,0,0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE);
}
}
The else
{//
For (jj=0; Jj & lt; MAX_WINS; Jj++)
{
M_paWnd [jj] - & gt; SetWindowPos (& amp; WndTop, 0,0,0,0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE);
}
}
//tell CMyWnd
CMyWnd: : m_ReverseOrder=!!! CMyWnd: : m_ReverseOrder;
}

Hello
The two functions is a response to what news?

CodePudding user response:

The
reference 7 floor zgl7903 response:
with a TabCtrl to manage these dialog window


Hello, due to the layout, the dialog cannot be put in a tabctrl,
  • Related