Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - How to insert a combobox?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to insert a combobox?

 Post Reply Post Reply
Author
Message
neverdie10 View Drop Down
Newbie
Newbie


Joined: 25 March 2007
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote neverdie10 Quote  Post ReplyReply Direct Link To This Post Topic: How to insert a combobox?
    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.
Back to Top
neverdie10 View Drop Down
Newbie
Newbie


Joined: 25 March 2007
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote neverdie10 Quote  Post ReplyReply Direct Link To This Post Posted: 26 March 2007 at 9:29pm
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();
}
}
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.250 seconds.