In-depth introduction to CChart one lesson per day-Happy high 4 13th Lesson Liu ti on the monthly, Win32 standard control ChartCtrl hand in hand, cchartchartctrl

Source: Internet
Author: User

In-depth introduction to CChart one lesson per day-Happy high 4 13th Lesson Liu ti on the monthly, Win32 standard control ChartCtrl hand in hand, cchartchartctrl

In the previous lesson, the new ChartCtrl control was introduced in the dialog box. This section briefly introduces another usage of this control.

First, follow the previous steps to create a Win32Application.

The following is a response routine for adding a WM_CREATE message.

Case WM_CREATE: HWND hW; hW = CreateWindow (_ T ("ChartCtrl"), _ T ("Cap"), WS_CHILD | WS_VISIBLE, 20, 20,600,400, hWnd, NULL, hInst, NULL); if (hW) {CChart * chart = GetChart (hW); for (int I =-10; I <= 10; I ++) {chart-> AddPoint2D (I, I * I);} ShowWindow (hWnd, SW_SHOW);} break;

Running effect.


Here we use CreateWindow to create a ChartCtrl control window, use the GetChart () function mentioned in the previous lesson to obtain the CChart pointer, and then operate on the pointer.

This lesson is very simple. It mainly shows that ChartCtrl is a registered window class and can be processed in the general Win32 API mode.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.