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