<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CComboBox - Icon vor jedem Eintrag, wie?]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie bekomme ich vor jeden Eintrag ein Icon?<br />
Man kann ja nicht wirklich bestimmen, vor welchen Eintrag welches Icon kommt. Es gibt die Funktion SetIcon, aber die bewirkt nicht wirklich was. Genau genommen garnichts <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<pre><code class="language-cpp">combo-&gt;SetIcon(LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ICON_FLOPPY)),false);
combo-&gt;AddString(&quot;hurz&quot;);
</code></pre>
<p>so dachte ich irgendwie.. aber Sinn macht es nicht unbedingt..</p>
<p>Danke für jede Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/64792/ccombobox-icon-vor-jedem-eintrag-wie</link><generator>RSS for Node</generator><lastBuildDate>Fri, 05 Jun 2026 04:04:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/64792.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Feb 2004 15:08:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CComboBox - Icon vor jedem Eintrag, wie? on Fri, 13 Feb 2004 15:08:48 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie bekomme ich vor jeden Eintrag ein Icon?<br />
Man kann ja nicht wirklich bestimmen, vor welchen Eintrag welches Icon kommt. Es gibt die Funktion SetIcon, aber die bewirkt nicht wirklich was. Genau genommen garnichts <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<pre><code class="language-cpp">combo-&gt;SetIcon(LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ICON_FLOPPY)),false);
combo-&gt;AddString(&quot;hurz&quot;);
</code></pre>
<p>so dachte ich irgendwie.. aber Sinn macht es nicht unbedingt..</p>
<p>Danke für jede Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/458675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/458675</guid><dc:creator><![CDATA[personenkult]]></dc:creator><pubDate>Fri, 13 Feb 2004 15:08:48 GMT</pubDate></item><item><title><![CDATA[Reply to CComboBox - Icon vor jedem Eintrag, wie? on Fri, 13 Feb 2004 15:29:19 GMT]]></title><description><![CDATA[<p>entweder OwnerDraw ComboBox oder ComboBoxEx.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/458712</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/458712</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Fri, 13 Feb 2004 15:29:19 GMT</pubDate></item><item><title><![CDATA[Reply to CComboBox - Icon vor jedem Eintrag, wie? on Sun, 15 Feb 2004 10:44:57 GMT]]></title><description><![CDATA[<p>Schau dir das mal an<br />
<a href="http://www.codeguru.com/listbox/IconLB.html" rel="nofollow">http://www.codeguru.com/listbox/IconLB.html</a><br />
und übertrage die Ideen auf CComboBox</p>
]]></description><link>https://www.c-plusplus.net/forum/post/459695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/459695</guid><dc:creator><![CDATA[a]]></dc:creator><pubDate>Sun, 15 Feb 2004 10:44:57 GMT</pubDate></item><item><title><![CDATA[Reply to CComboBox - Icon vor jedem Eintrag, wie? on Sun, 15 Feb 2004 14:35:13 GMT]]></title><description><![CDATA[<p>Das einfachste ist sicher eine CComboBoxEx.</p>
<p>Die Icons malst du alle nebeneinander in ein Bitmap, daraus konstruierst du eine CImageList (Member vom Dialog). mit cbx.SetImageList der ComboBox bescheid sagen, wo die Boilder herkommen sollen, und dann noch eine kleine Hilfsfunktion:</p>
<pre><code class="language-cpp">/// \param cbx: Pointer to the ComboBoxEx ctrl
/// \param item: insertion index, or -1 to append at end
/// \param text: Text of the new item
/// \param img: icon index in the image list (provided by SetImageList)
/// \param selImg: icon image in the image list to display when the item is selected
/// \param lp: caller defined parameter associated with the item (&quot;ItemData&quot;)
bool CBxInsertItem(CComboBoxEx * wnd, int item, LPCTSTR text, int img = -1, int selImg = -1, LPARAM lp = 0)
{
  _ASSERTE(::IsWindow(wnd-&gt;GetSafeHwnd()));
  if (!::IsWindow(wnd-&gt;GetSafeHwnd())) 
    return -1;

  COMBOBOXEXITEM cbx;
  ZeroMemory(&amp;cbxItem, sizeof(cbxItem));
  if (item &lt; 0)     // append item at end:
    item = wnd-&gt;GetItemCount();  
  cbx.mask = CBEIF_TEXT | CBEIF_LPARAM;
  cbx.iItem = item;
  cbx.pszText = text;
  if (img &gt;= 0) {  // add image
    cbx.mask |= CBEIF_IMAGE;
    cbx.iImage = img;
  }
  if (selIng &gt;= 0) {  // add selected image
    cbx.mask |= CBEIF_SELECTEDIMAGE;
    cbx.iImage = selImg;
  }
  return wnd-&gt;InsertItem(&amp;cbx);

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/459848</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/459848</guid><dc:creator><![CDATA[peterchen]]></dc:creator><pubDate>Sun, 15 Feb 2004 14:35:13 GMT</pubDate></item></channel></rss>