本文整理汇总了C++中CListBox::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ CListBox::Create方法的具体用法?C++ CListBox::Create怎么用?C++ CListBox::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CListBox
的用法示例。
在下文中一共展示了CListBox::Create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CInPlaceList
CListBox *CClickList::ShowInPlaceList(int Row, int Col)
{
CListBox *pListBox = new CInPlaceList(Row, Col, GetItemText(Row, Col));
ASSERT_VALID(pListBox);
CRect Rect = GetInPlaceRect(Row, Col);
Rect.bottom += 75;
pListBox->Create(WS_BORDER | WS_CHILD | WS_VISIBLE, Rect,
this, IDL_INPLACE_LIST);
pListBox->SetFocus();
return pListBox;
}
示例2: CreateThreadpoolWork
BOOL OnCreate( LPCREATESTRUCT lpCreateStruct ){
m_pWorkItem = CreateThreadpoolWork( WorkerThread, this, NULL );
if( m_pWorkItem == NULL ){
return FALSE;
}
m_btnStart.Create(this, 10, 10, 100, 25, IDC_START_BTN, _T("START"));
m_btnStart.SetFont();
m_ListBox.Create(this, 10, 30, 200, 200, IDC_LISTBOX);
m_ListBox.SetFont();
cmd.Initialize( this );
cmd.Register( IDC_START_BTN, &CMainForm::OnStartBatch );
msg.Initialize( this );
msg.Register( WM_APP_COMPLETED, &CMainForm::OnCompleted );
return TRUE;
}
示例3: ShowInPlaceListBox
CListBox* CPlayerListCtrl::ShowInPlaceListBox(int nItem, int nCol, CAtlList<CString>& lstItems, int nSel)
{
CRect rect;
if (!PrepareInPlaceControl(nItem, nCol, rect)) {
return nullptr;
}
DWORD dwStyle = WS_BORDER | WS_CHILD | WS_VISIBLE | WS_VSCROLL/*|WS_HSCROLL*/ | LBS_NOTIFY;
CListBox* pListBox = DEBUG_NEW CInPlaceListBox(nItem, nCol, lstItems, nSel);
pListBox->Create(dwStyle, rect, this, IDC_LIST1);
CRect ir;
GetItemRect(m_nItemClicked, &ir, LVIR_BOUNDS);
pListBox->SetItemHeight(-1, ir.Height());
CDC* pDC = pListBox->GetDC();
CFont* pWndFont = GetFont();
pDC->SelectObject(pWndFont);
int width = GetColumnWidth(nCol);
POSITION pos = lstItems.GetHeadPosition();
while (pos) {
int w = pDC->GetTextExtent(lstItems.GetNext(pos)).cx + 16;
if (width < w) {
width = w;
}
}
ReleaseDC(pDC);
CRect r;
pListBox->GetWindowRect(r);
ScreenToClient(r);
r.top = ir.bottom;
r.bottom = r.top + pListBox->GetItemHeight(0) * (pListBox->GetCount() + 1);
r.right = r.left + width;
pListBox->MoveWindow(r);
m_fInPlaceDirty = false;
return pListBox;
}