![]() |
How to insert a combobox? |
Post Reply ![]() |
Author | |
neverdie10 ![]() Newbie ![]() Joined: 25 March 2007 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 26 March 2007 at 12:06am |
Hello.
I want to insert a combobox in column. How to insert? class CRRListView : public CXTPReportView { public: void InitListCtrl(); }; void CRRListView::InitListCtrl() { ... // Add sample records m_wndReport.AddRecord(new CMessageRecord( _T("Item1"), _T("Item2"), _T("Item3"), _T("Item4"), 1, _T("Item5"), _T("Item6"), _T("Item7"), _T("Item8") //--> Want to insert a combobox ) ); } Thanks. |
|
![]() |
|
neverdie10 ![]() Newbie ![]() Joined: 25 March 2007 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
class CRRListView : public CXTPReportView
{ proteced: CComboBoxExt* m_pListCombo; }; void CRRListView::OnReportItemClick(NMHDR* pNotifyStruct, LRESULT* /*result*/) { XTP_NM_REPORTRECORDITEM* pItemNotify = (XTP_NM_REPORTRECORDITEM*)pNotifyStruct; if( !pItemNotify->pItem ) return; //ASSERT(pItemNotify->pColumn); if( pItemNotify->pItem->GetIndex() == 8 ) { // Is already combo box is there? if( m_pListCombo ) { // Kill the focus of combo box SetFocus(); // Delete combo box delete m_pListCombo; m_pListCombo = NULL; } CRect crRect = pItemNotify->pRow->GetItemRect( pItemNotify->pItem ); m_pListCombo = new CComboBoxExt; crRect.bottom += 100; m_pListCombo->Create(WS_CHILD | WS_VISIBLE |WS_TABSTOP | CBS_DROPDOWNLIST | WS_VSCROLL |WS_HSCROLL,crRect,&GetReportCtrl(),ID_COMBO); m_pListCombo->SetFocus(); } } |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |