Make your Software interface more beautiful (4)

Source: Internet
Author: User

Beautiful interface of the software should have a beautiful menu, everyone on the Windows XP Start menu is certainly not unfamiliar with it, the menu unique style. So went to study, and found that it is not true CMenu also not its derived class, the analysis of its structure found that it is mainly composed of two ListView, a toolbar, a Button. So also wrote a menu class, but I did not use ListView to achieve, although not as compared to Windows XP, but I think it is a personalized menu, take out and share! I hope you can write a menu of innovative and independent property rights. Ha ha....... Of course, seeing is the following picture.

First, the realization principle

Use CWnd and CButton to achieve. The main class file is Cyisong Menu.cpp CyisongMenu.h.

Two, the menu uses the method explanation

Class public variable definition:

CYisongMenu m_GroupMenu;
CYisongMenu m_SubGroupMenu;//子菜单

Set avatar and Add menu items:

m_GroupMenu.SetMenuHeader("我的主菜单",IDI_QQ, TRUE );
  m_GroupMenu.AppendMenuItem("退出系统",
  IDC_SUBITEM, //菜单ID
  IDI_ICON1, // 图标
  NULL, //子菜单指针
  MENU_NORMAL|MENU_FONTBOLD//风格参数
);
m_GroupMenu.AppendMenuItem("功能菜单2",
  IDC_SUBITEM+1,
  IDI_ICON2,
  NULL,
  MENU_NORMAL );

Continue adding menu items with Appendmenuitem,

Finish creating

m_GroupMenu.CreateGroupMenu(this,CRect(0,0,150,300),IDC_MENU,1,1);

This completes the creation process, and if you want to create a child menu, go back to a.

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.