Learning Remote Control Interface Design One: program Interface size

Source: Internet
Author: User

Create a new MFC project.

are as follows:

Maximize and minimize each turn on. This is the program.

How to let the program follow the size itself changes. Add a variable to the control first.

Add a response message to the window at the same time.


voidCghostdlg::onsize (UINT NType,intCxintcy)    {cdialogex::onsize (NType, CX, CY); if(M_list_oline.m_hwnd!=null)//Change the on- line address size{CRect rc; Rc.left=1;//the left coordinate of the listrc.top= the;//top coordinates of the listrc.right=cx-1;//the right coordinate of the listrc.bottom=cy- the;//bottom coordinate of the listM_list_oline.    MoveWindow (RC); }    if(M_list_msg.m_hwnd!=null)//change the size of the log box{CRect rc; Rc.left=1;//the left coordinate of the listrc.top=cy-156;//top coordinates of the listrc.right=cx-1;//the right coordinate of the listrc.bottom=cy-6;//bottom coordinate of the listm_list_msg.    MoveWindow (RC); }    //todo:add your message handler code here}

Finally, we find that the window has a problem with small changes. So we need to move our hands in the initialization window.

    CRect rect;    GetWindowRect (&rect);    Rect.bottom+=;    MoveWindow (rect);

Well, then it's finished. Look at the results.

No matter how large our program is, the size of the control changes.

Learning Remote Control Interface Design One: program Interface size

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.