Print Page | Close Window

combo box

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1443
Printed Date: 07 November 2025 at 1:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: combo box
Posted By: shahaf
Subject: combo box
Date Posted: 23 November 2004 at 9:14am

I would like to use a combo box with icons and indentation in a dialog.

I have tried to use CXTComboBoxEx according to the example in the CommonControls project, and it just does not work.

 




Replies:
Posted By: Oleg
Date Posted: 24 November 2004 at 12:25am

Maybe you forgot to add ON_XTP_CREATECONTROL() macros?

For Dialog Sample add:

ON_XTP_CREATECONTROL() to message map,

int CDialogSampleDlg::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
{
 if (lpCreateControl->nID == ID_BUTTON_PLAY)
 {
  if (!m_wndComboBox.Create(WS_TABSTOP | WS_CHILD | WS_VISIBLE |CBS_DROPDOWN
,
   CRect(0, 0, 100, 100), this, 100))
  {
   return FALSE;
  }
  COMBOBOXEXITEM cbItem;
  ZeroMemory(&cbItem, sizeof(COMBOBOXEXITEM));
  cbItem.mask = CBEIF_TEXT;
  cbItem.pszText = _T("Manager");

  m_wndComboBox.InsertItem(&cbItem);


  cbItem.pszText = _T("Administrator");
  m_wndComboBox.InsertItem(&cbItem);
  
  
  
  CXTPControlCustom* pControl = CXTPControlCustom::CreateControlCustom(&m_wndComboBox);& nbsp; 
  
  pControl->SetBorders(3, 3, 3, 3);
  pControl->SetVerticalPositionOption(xtpVertic alShow);

  lpCreateControl->pControl = pControl;
  return TRUE;
 }
 return FALSE;
}

 

declaration:

CComboBoxEx m_wndComboBox;
int OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl);



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net