pCtrl = new CFlatComboBox;
ASSERT_VALID( pCtrl );
int nIndex = CommandToIndex(nID);
SetButtonInfo(nIndex, nID, TBBS_SEPARATOR, rect.Width()); GetItemRect(nIndex, &rect); //设置位置
rect.top += 5;
rect.bottom += 200; if(((CFlatComboBox*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
{
delete pCtrl;
return NULL;
}
我在工具栏上放置了一个组合控件,但是出现一个问题:工具栏中多出了一条分割线:
ASSERT_VALID( pCtrl );
int nIndex = CommandToIndex(nID);
SetButtonInfo(nIndex, nID, TBBS_SEPARATOR, rect.Width()); GetItemRect(nIndex, &rect); //设置位置
rect.top += 5;
rect.bottom += 200; if(((CFlatComboBox*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
{
delete pCtrl;
return NULL;
}
我在工具栏上放置了一个组合控件,但是出现一个问题:工具栏中多出了一条分割线:
// find the button(PlaceHolder)
int idx=0;
while(m_wndToolBar.GetItemID(idx) != ID_COMBO_IN_TOOLBAR) idx++;
// change to a separetor with needeed width
m_wndToolBar.SetButtonInfo( idx,ID_COMBO_IN_TOOLBAR,TBBS_SEPARATOR,CTRL_WIDTH);
// set combo size
CRect rc;
m_wndToolBar.GetItemRect(idx,&rc);
rc.bottom += 200;//droplist
// create new
// event map likes: ON_CBN_EDITCHANGE(ID_COMBO_IN_TOOLBAR, OnEditchangeCombo1)
m_DlgCombo1.Create(WS_CHILD|WS_VISIBLE|CBS_AUTOHSCROLL|CBS_DROPDOWN|CBS_HASSTRINGS,
rc,&m_wndToolBar,
ID_COMBO_IN_TOOLBAR);// !!!!!
// fill drop list
m_DlgCombo1.ShowWindow(SW_SHOW);
m_DlgCombo1.AddString("xxxx");
m_DlgCombo1.AddString("yyyy");
m_DlgCombo1.AddString("zzzz");
m_DlgCombo1.SetCurSel(0);//E800->E8FF // reposQuery, rcClientNow);