Print Page | Close Window

CXTPControlComboBox with images ?

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=12549
Printed Date: 23 June 2025 at 6:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlComboBox with images ?
Posted By: lion
Subject: CXTPControlComboBox with images ?
Date Posted: 28 October 2008 at 6:06am
Hi
is there a ComboBox that supports icons for every entry ?
cu B



Replies:
Posted By: Oleg
Date Posted: 28 October 2008 at 10:59am
Hi,
 
You need SetListIconId method.


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


Posted By: lion
Date Posted: 29 October 2008 at 4:25am
Hi,
thanx for your help.
i tried doing that in the ComandBarControls Example in the file MainFrm.cpp but it did not show any effect. I just inserted it after creating a new icon around line number 111:
    CXTPToolBar* pToolBarCombo = pCommandBars->Add(_T("Combo"), xtpBarTop);
    pToolBarCombo->SetBarID(IDR_MAINFRAME + 3);
    pToolBarCombo->GetControls()->Add(xtpControlLabel, 0)->SetCaption(_T("CXTPControlComboBox:"));
    pToolBarCombo->GetControls()->Add(xtpControlComboBox, ID_FILE_NEW);
    CXTPControlComboBox* pControlCombo = (CXTPControlComboBox*)pToolBarCombo->GetControls()->Add(xtpControlComboBox, ID_FILE_NEW);
    pControlCombo->AddString("asdf1");
    pControlCombo->AddString("asdf2");
    pControlCombo->AddString("asdf3");
    pControlCombo->AddString("asdf4");
    pControlCombo->SetDropDownListStyle();
    DockRightOf(pToolBarCombo, pToolBarPopups);

    pControlCombo->SetListIconId(IDI_ICON1);

and pControlCombo->IsImageVisible(); returns false.

the thing I want to achieve is that I have an Icon/Image per Item in the list:


we have several such controls to choose patterns etc.
how do i do this with an CXTPControlComboBox ?

I would appreciate your help very much.
Thanx.

Cheers Björn




Posted By: lion
Date Posted: 01 December 2008 at 3:43am
Hi,
it still did not seem to work. What could be wrong?
Cheers B


Posted By: mgampi
Date Posted: 23 January 2009 at 9:00am
Hello Björn;

have you ever solved this;
otherwise does anyone know how to solve it?


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: mgampi
Date Posted: 23 January 2009 at 9:31am
Hi;

I solved it by myself. Using SetListIconId did it, but the order of calling SetListIconId and AddString is important!

BTW: if I set SetDropDownListStyle(FALSE), why is the icon of the selected listbox item not automatically set in the edit control? Should be improved!


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: foxars
Date Posted: 27 January 2009 at 7:59pm
Hi,

Please tell me how did you do with SetListIconId ??!!

Thanks


Posted By: mgampi
Date Posted: 11 February 2009 at 3:40pm
Hi;
Try this:
    if (lpCreateControl->nID == ID_RESULTS_TRANSACTIONTYPE)
    {
        lpCreateControl->pControl->SetWidth(250);
        CXTPControlComboBox* pCombo=reinterpret_cast<CXTPControlComboBox*>(lpCreateControl->pControl);
        pCombo->SetListIconId(TransactionUnknown);
        pCombo->SetDropDownListStyle(FALSE);
        pCombo->SetFlags(xtpFlagLeftPopup);
        pCombo->AddString(_T("Alle anzeigen"));
        pCombo->AddString(_T("Produktionssätze"));
        pCombo->AddString(_T("Verbrauchssätze"));
        pCombo->AddString(_T("Stillstandssätze"));
       
        pCombo->SetCurSel(0);

        return;
    }



-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



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