1个回答
展开全部
BOOL CreateEx(CWnd* pParentWnd, DWORD dwCtrlStyle = TBSTYLE_FLAT, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, CRect rcBorders = CRect(0, 0, 0, 0), UINT nID = AFX_IDW_TOOLBAR);
参数意义:
pParentWnd
Pointer to the window that is the toolbar’s parent.
dwCtrlStyle
Additional styles for the creation of the embedded CToolBarCtrl object. By default, this value is set to TBSTYLE_FLAT. For a complete list of toolbar styles, see dwStyle.
dwStyle
The toolbar style. See Toolbar Control and Button Styles in the Platform SDK for a list of appropriate styles.
rcBorders
A CRect object that defines the widths of the toolbar window borders. These borders are set to 0,0,0,0 by default, thereby resulting in a toolbar window with no borders.
nID
The toolbar’s child-window ID.
按钮风格:
Toolbar Control and Button Styles:
TBSTYLE_ALTDRAG、TBSTYLE_CUSTOMERASE、TBSTYLE_FLAT、TBSTYLE_LIST、
TBSTYLE_REGISTERDROP、TBSTYLE_TOOLTIPS、TBSTYLE_TRANSPARENT、TBSTYLE_WRAPABLE
使用例子:
if (!m_wndMyToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndMyToolBar.LoadToolBar(IDR_MYTOOLBAR))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
按钮风格
pParentWnd :toolbar的父控件的句柄
dwCtrlStyle:创建CToolBarCtrl对象时的应用风格,默认值设置为TBSTYLE_FLAT
完善toolbar的风格具体的看dwStyle
dwStyle:工具栏按钮显示时的适当的风格
rcBorders: 一个定义了toolbar边框宽度的CRect 对象
默认设置为0,0,0,0 因此默认情况下toolbar是没有边框的
nID:toolbar子窗口ID
TBSTYLE_ALTDRAG拖拽、TBSTYLE_CUSTOMERASE定制消息提示、TBSTYLE_FLAT平滑、TBSTYLE_LIST右位图的按钮文本平滑、TBSTYLE_REGISTERDROP下拉、TBSTYLE_TOOLTIPS工具提示、TBSTYLE_TRANSPARENT透明、TBSTYLE_WRAPABLE 使工具条控制按钮具有多行排列格式
这个你只需要在程序中试试就可以看到效果
参数意义:
pParentWnd
Pointer to the window that is the toolbar’s parent.
dwCtrlStyle
Additional styles for the creation of the embedded CToolBarCtrl object. By default, this value is set to TBSTYLE_FLAT. For a complete list of toolbar styles, see dwStyle.
dwStyle
The toolbar style. See Toolbar Control and Button Styles in the Platform SDK for a list of appropriate styles.
rcBorders
A CRect object that defines the widths of the toolbar window borders. These borders are set to 0,0,0,0 by default, thereby resulting in a toolbar window with no borders.
nID
The toolbar’s child-window ID.
按钮风格:
Toolbar Control and Button Styles:
TBSTYLE_ALTDRAG、TBSTYLE_CUSTOMERASE、TBSTYLE_FLAT、TBSTYLE_LIST、
TBSTYLE_REGISTERDROP、TBSTYLE_TOOLTIPS、TBSTYLE_TRANSPARENT、TBSTYLE_WRAPABLE
使用例子:
if (!m_wndMyToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndMyToolBar.LoadToolBar(IDR_MYTOOLBAR))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
按钮风格
pParentWnd :toolbar的父控件的句柄
dwCtrlStyle:创建CToolBarCtrl对象时的应用风格,默认值设置为TBSTYLE_FLAT
完善toolbar的风格具体的看dwStyle
dwStyle:工具栏按钮显示时的适当的风格
rcBorders: 一个定义了toolbar边框宽度的CRect 对象
默认设置为0,0,0,0 因此默认情况下toolbar是没有边框的
nID:toolbar子窗口ID
TBSTYLE_ALTDRAG拖拽、TBSTYLE_CUSTOMERASE定制消息提示、TBSTYLE_FLAT平滑、TBSTYLE_LIST右位图的按钮文本平滑、TBSTYLE_REGISTERDROP下拉、TBSTYLE_TOOLTIPS工具提示、TBSTYLE_TRANSPARENT透明、TBSTYLE_WRAPABLE 使工具条控制按钮具有多行排列格式
这个你只需要在程序中试试就可以看到效果
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询