Disable the close button of the MDI subwindow \ Display Mode of multiple views in the MDI

Source: Internet
Author: User

 

1. Modify the onclose message function of the subwindow as follows:Code:
Void cchildframe: onclose ()
{
// When you press Ctrl + F4, the window will not be closed.
// Cmdichildwnd: onclose ();
}

2. Add the oncreate message function of the subwindow and change it to the following code:
Int cchildframe: oncreate (maid)
{
If (cmdichildwnd: oncreate (lpcreatestruct) =-1)
Return-1;
 
Cmenu * pmenu = getsystemmenu (false );
If (pmenu)
{
Pmenu-> enablemenuitem (SC _close, mf_bycommand | mf_grayed );
}
Return 0;
}
// ---------- Display mode of multiple views in MDI
Void cmainframe: onaa ()
{
// Add the following line of code under cmdiframewnd
Mditile (mditile_horizontal );

}

Void mditile (INT ntype );
Parameter: ntype specifies the tile flag. This parameter can only be one of the following values:
· Mditile_horizontal tiled MDI subwindow so that one window can appear on the other.
· Mditile_skipdisabled prevents invalid MDI subwindows from being tiled.
· Mditile_vertical tiled MDI subwindow so that one window can appear next to the other.
Mditile (mditile_horizontal );

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.