我想实现工具栏的按钮按下不弹起的效果,再次按才弹起
看网上的说法是CToolBar实现不了这样的效果,所以就用了CToolBarCtrl::AddButtons函数
部分代码如下CToolBarCtrl & toolCtrl=m_wnd2DCToolBar.GetToolBarCtrl();
TBBUTTON tb[6];
for(int i=0; i<6; i++)
{
tb[i].iBitmap = i;
tb[i].fsState = TBSTATE_ENABLED;
tb[i].fsStyle = TBSTYLE_CHECK; // 这里实现了按下不弹起的效果
tb[i].iString=i;
tb[i].dwData=0;
}tb[0].idCommand = ID_0;
tb[1].idCommand = ID_1;
tb[2].idCommand = ID_2;
tb[3].idCommand = ID_3;
tb[4].idCommand = ID_4;
tb[5].idCommand = ID_5;toolCtrl.AddButtons(6,tb);问题就在于tb[i].iBitmap = i和tb[i].iString=i,好像只能添加该工具栏前面有的工具按钮图标和提示,不能添加另外的图标,这样就造成了有两个重复的功能按钮
请问有什么办法能载入另外的工具按钮图标和提示
看网上的说法是CToolBar实现不了这样的效果,所以就用了CToolBarCtrl::AddButtons函数
部分代码如下CToolBarCtrl & toolCtrl=m_wnd2DCToolBar.GetToolBarCtrl();
TBBUTTON tb[6];
for(int i=0; i<6; i++)
{
tb[i].iBitmap = i;
tb[i].fsState = TBSTATE_ENABLED;
tb[i].fsStyle = TBSTYLE_CHECK; // 这里实现了按下不弹起的效果
tb[i].iString=i;
tb[i].dwData=0;
}tb[0].idCommand = ID_0;
tb[1].idCommand = ID_1;
tb[2].idCommand = ID_2;
tb[3].idCommand = ID_3;
tb[4].idCommand = ID_4;
tb[5].idCommand = ID_5;toolCtrl.AddButtons(6,tb);问题就在于tb[i].iBitmap = i和tb[i].iString=i,好像只能添加该工具栏前面有的工具按钮图标和提示,不能添加另外的图标,这样就造成了有两个重复的功能按钮
请问有什么办法能载入另外的工具按钮图标和提示
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货