关于toolbar的有关问题
关于toolbar的问题
两种create toolbar的方法:toolbar自己的数据结构是怎样的?能否将每一个button对应的image分别load进toolbar?
1
Create a toolbar resource.
Construct the CToolBar object.
Call the Create (or CreateEx) function to create the Windows toolbar and attach it to the CToolBar object.
Call LoadToolBar to load the toolbar resource.
Otherwise, follow these steps:
2
Construct the CToolBar object.
Call the Create (or CreateEx) function to create the Windows toolbar and attach it to the CToolBar object.
Call LoadBitmap to load the bitmap that contains the toolbar button images.
Call SetButtons to set the button style and associate each button with an image in the bitmap.
另外,vs.studio默认生成的一段代码:
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
最后的LoadToolBar(IDR_MAINFRAME)在参数中怎么起作用的?
------解决方案--------------------
up
两种create toolbar的方法:toolbar自己的数据结构是怎样的?能否将每一个button对应的image分别load进toolbar?
1
Create a toolbar resource.
Construct the CToolBar object.
Call the Create (or CreateEx) function to create the Windows toolbar and attach it to the CToolBar object.
Call LoadToolBar to load the toolbar resource.
Otherwise, follow these steps:
2
Construct the CToolBar object.
Call the Create (or CreateEx) function to create the Windows toolbar and attach it to the CToolBar object.
Call LoadBitmap to load the bitmap that contains the toolbar button images.
Call SetButtons to set the button style and associate each button with an image in the bitmap.
另外,vs.studio默认生成的一段代码:
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
最后的LoadToolBar(IDR_MAINFRAME)在参数中怎么起作用的?
------解决方案--------------------
up