Software framework of the tool, Tangrammini component Application Tutorial three: basic use

Source: Internet
Author: User

In the previous article I introduced the use of Setwnd () and save (), and I'm sure you already know how to install your own widgets, and in this article I'll explain the basic methods of Tangramminictrl components, and a model of transforming the Tutorial1 dialog box program into a software.

First, let's Change the dialog box program. Because it's a framework program, so as a dialog we assume that the dialog box needs to change the size of the form, we first change the form properties, show the Main dialog Box Properties dialog box (View-> properties), in the Dialog Properties dialog box, Go to the Styles page, select resizing in the Border list, and choose Minimize box and Maximize boxes checkbox to prevent the control from blinking when it changes size, select Clip children option, and finally the following illustration shows:

After this change, the dialog box can be resized or maximized and minimized when it is run, but the Tangramminictrl component we are painting does not synchronize the size of the change, so it is necessary to respond to the main dialog box that does wm_size the message. and changes the size of the Tangramminictrl component during this message processing.

First, in response to the wm_size message, in ClassView, right-click the main dialog Class (Ctutorial1dlg) and select Add Windows message Handler in the right-click menu ... Item, in the dialog box that pops up, select Wm_size from the new Windows messages/events list on the left and double-click (same as after clicking Add handler), which automatically adds wm_size messages to the right existing Message/event the Handlers list. Then in the list on the right, double-click Wm_size Item, VC automatically go to OnSize (...) function, we add the following code here:

if (IsWindow(m_wndMiniCtrl.m_hWnd))
{
     m_wndMiniCtrl.MoveWindow(0,0,cx,cy,false);
}

The final code is as follows:

Related Article

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.