Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dropdown list not showup for ActiveX Control from CComboBox

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am developing a set of activeX controls with MFC.
One of my controls is derived from CComboBox. But I found the drop down list
cannot show up when I press the dropdown button.
Kindly please give me some tip about this problem.

thanks for your attention and regards
Looking forward to your reply
chenyinghong@hotmail.com
***********************************************************************
the following is an expert from my source codes:

BOOL CFontFaceComboCtrl::preCreateWindow(CREATESTRUCT& cs)
{
cs.lpszClass = _T("COMBOBOX");
cs.style &= ~(CBS_SIMPLE | CBS_DROPDOWN);
cs.style |= CBS_DROPDOWNLIST;
return COleControl::preCreateWindow(cs);
}

int CFontFaceComboCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{

if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
long ret = SendMessage(CB_INSERTSTRING, 0, (long)"font1");
ret = SendMessage(CB_INSERTSTRING, 1, (long)"font2");
ret = SendMessage(CB_INSERTSTRING, 2, (long)"font3");
ret = SendMessage(CB_INSERTSTRING, 3, (long)"font4");
ret = SendMessage(CB_INSERTSTRING, 4, (long)"font5");
SendMessage(CB_SETCURSEL, 2, 0l);
//SetControlSize(80, 120); no use

return 0;
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top