To make a web-like ant, Pull-tab

Source: Internet
Author: User
Tags class definition

Anyone who has used the network ants know that the network ant interface in the lower right corner of the tab is different from the General tab. It is moving, when the tab is clicked, the corresponding child interface moves from left to right, giving the whole software a dynamic. The author uses vc++6.0 also to achieve a similar tab effect. This tab has the following characteristics:

1. Overcome the vc++6.0 provided by the tab must design all the controls on the same interface defect, each tab is a separate dialog box

2. To achieve a similar network of ants pull the curtain Type tab

This article program operation effect Chart one

A. Class definition: The author is by encapsulating a simple Cmytab class to implement, the class header file part of the code is as follows:

class CMyTab : public CTabCtrl
{
//////.................................省略一部分代码
public:
int m_ispeed;//运动速度
BOOL m_bMove;//是否运动
int m_wndwidth;//子窗体的宽度
CPoint m_bottomright;//子窗体右下角的坐标
CPoint m_topleft;//子窗体左上角的坐标
CWnd *m_pCurWnd;//当前窗体
CRect m_tabrect;//Tab的矩形区域
CPoint m_ptTabs;//左上角坐标
void AddItem(CWnd *pwnd,LPTSTR name);//添加选项卡
int m_itemcount;//Item总数
virtual ~CMyTab();
// Generated message map functions
protected:
//{{AFX_MSG(CMyTab)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult);
/

This article supporting source code

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.