当前位置:网站首页>Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
2022-07-04 19:42:00 【Spring buds and summer lotus_ seven hundred and twenty-eight mi】
1、 Create a new sub dialog box and modify the properties , Create a new class at the same time NyPage1
2、 In the dialog box of new project default class , Add one pic Control and modify hidden properties
3、 Modify the contents of the default class :
(1) Header file
Add destructor :
~CBCGTabWndSampleDlg()
{
if (_NyPage1 != nullptr)
{
delete _NyPage1;
_NyPage1 = nullptr;
}
if (_NyPage2 != nullptr)
{
delete _NyPage2;
_NyPage2 = nullptr;
}
}
Define members :
CBCGPTabWnd m_wndTab;
NyPage1 *_NyPage1;
NyPage1 *_NyPage2;
afx_msg LRESULT OnMoveTab(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnChangeActiveTab(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnRenameTab(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnChangeTabSelection(WPARAM wp, LPARAM lp);
(2) In the implementation file
Message response
N_REGISTERED_MESSAGE(BCGM_ON_MOVE_TAB, CBCGTabWndSampleDlg::OnMoveTab)
// Switch tab Responding to events
ON_REGISTERED_MESSAGE(BCGM_CHANGE_ACTIVE_TAB, CBCGTabWndSampleDlg::OnChangeActiveTab)
ON_REGISTERED_MESSAGE(BCGM_ON_RENAME_TAB, CBCGTabWndSampleDlg::OnRenameTab)
ON_REGISTERED_MESSAGE(BCGM_CHANGE_TAB_SELECTION, CBCGTabWndSampleDlg::OnChangeTabSelection)
BOOL CBCGTabWndSampleDlg::OnInitDialog()
{
CBCGPDialog::OnInitDialog();
CRect rectTab;
GetDlgItem(IDC_TAB)->GetWindowRect(&rectTab);
ScreenToClient(&rectTab);
m_wndTab.Create(CBCGPTabWnd::STYLE_3D, rectTab, this, 1, CBCGPTabWnd::LOCATION_TOP);
{
_NyPage1 = new NyPage1();
_NyPage1->Create(NyPage1::IDD, &m_wndTab);
m_wndTab.AddTab(_NyPage1, _T(" first page "), 0);
_NyPage2 = new NyPage1();
_NyPage2->Create(NyPage1::IDD, &m_wndTab);
m_wndTab.AddTab(_NyPage2, _T(" The second page "), 1);
}
m_wndTab.SetActiveTab(0);
m_wndTab.RecalcLayout();
m_wndTab.RedrawWindow();
return TRUE; // return TRUE unless you set the focus to a control
}
LRESULT CBCGTabWndSampleDlg::OnMoveTab(WPARAM wp, LPARAM lp)
{
return 1;
}
LRESULT CBCGTabWndSampleDlg::OnChangeActiveTab(WPARAM wp, LPARAM lp)
{
return 1;
}
LRESULT CBCGTabWndSampleDlg::OnRenameTab(WPARAM wp, LPARAM lp)
{
return 1;
}
LRESULT CBCGTabWndSampleDlg::OnChangeTabSelection(WPARAM wp, LPARAM lp)
{
return 1;
}
thus , You can see its simple effect , No beautification :
边栏推荐
- kotlin 继承
- Some thoughts on whether the judgment point is located in the contour
- Online data migration scheme encountered in the project 1 - general idea sorting and technical sorting
- To sort out messy header files, I use include what you use
- Find the nth power of 2
- BCG 使用之新建向导效果
- Allure of pytest visual test report
- 更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
- 1007 maximum subsequence sum (25 points) (PAT class a)
- 牛客小白月赛7 F题
猜你喜欢
Euler function
Online text line fixed length fill tool
C语言-入门-基础-语法-流程控制(七)
PolyFit软件介绍
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
Hough transform Hough transform principle
Some thoughts on whether the judgment point is located in the contour
The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
多表操作-外连接查询
abc229 总结(区间最长连续字符 图的联通分量计数)
随机推荐
Shell 編程核心技術《四》
Stream stream
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
Educational codeforces round 22 E. Army Creation
The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
socket编程demo二
Niuke Xiaobai monthly race 7 I new Microsoft Office Word document
Cbcgpprogressdlgctrl progress bar used by BCG
BCG 使用之CBCGPProgressDlgCtrl進度條使用
The difference and usage between substr (), slice (), and substring () in the string interception methods of "understand series after reading"
QT realizes interface sliding switching effect
1009 product of polynomials (25 points) (PAT class a)
How test engineers "attack the city" (Part I)
English语法_名词 - 使用
1006 sign in and sign out (25 points) (PAT class a)
TCP两次挥手,你见过吗?那四次握手呢?
1002. A+B for Polynomials (25)(PAT甲级)
Online data migration scheme encountered in the project 1 - general idea sorting and technical sorting
kotlin 继承
【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案