Seventh Week item 2-optional graphical user interface program development

Source: Internet
Author: User

After these days of use VS, found that in fact, and VB still have some of the same place, so for the control still can well understand their role.

This is today on the machine to write a "cuboid solution" program, mainly more practice, familiar with.

Create a "Bank" project, in Bankget.h, create a class:

Class Bank{private:int Leight;int weight;int height;public:void get (int, int, int); int getarea (); int getvo ();};

In Bankget.cpp, complete the declaration of the built-in function:

#include "stdafx.h" #include "Bank.h" #include "bankget.h" void bank::get (int l, int w, int h) {leight = L;weight = W;height = H;} int Bank::getarea () {return (2 * (leight*weight + weight*height + leight*height));} int Bank::getvo () {return (leight*height*weight);}

In BankDlg.cpp, increase the function implementation of button buttons:

void Cbankdlg::onbnclickedbutton1 () {updatedata (); Bank B1;b1.get (b_l, B_w, b_h); B_area = B1.getarea (); b_vo = B1.getvo (); UpdateData (false);}

Results



@ Mayuko


Seventh Week item 2-optional graphical user interface program development

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.