<?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[Combobox Anzahl der Einträge]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>wie kann ich die Anzahl der Einträge in einer Combobox ermitteln?</p>
<p>Ich habe testweise 3 Einträge hinzugefügt, aber m_combobox.GetCount() liefert immer 0 zurück.</p>
<p>Könnt ihr mir einen Tipp geben?</p>
<p>Danke im voraus.<br />
Grüsse<br />
xthing</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/156527/combobox-anzahl-der-einträge</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Jul 2026 00:03:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/156527.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Aug 2006 13:32:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Combobox Anzahl der Einträge on Thu, 17 Aug 2006 13:32:46 GMT]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>wie kann ich die Anzahl der Einträge in einer Combobox ermitteln?</p>
<p>Ich habe testweise 3 Einträge hinzugefügt, aber m_combobox.GetCount() liefert immer 0 zurück.</p>
<p>Könnt ihr mir einen Tipp geben?</p>
<p>Danke im voraus.<br />
Grüsse<br />
xthing</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1119207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1119207</guid><dc:creator><![CDATA[xthing]]></dc:creator><pubDate>Thu, 17 Aug 2006 13:32:46 GMT</pubDate></item><item><title><![CDATA[Reply to Combobox Anzahl der Einträge on Thu, 17 Aug 2006 13:53:06 GMT]]></title><description><![CDATA[<p>kommt darauf an wo du die abfrage hinsetz.</p>
<p>wenn du sie in die oninit deines dialoges schreibst &amp; die einträge manuell im resourcen editor hinzugefügt hast kann es nur 0 zurückgeben da der dialog erst erstellt wird. folglich stehen noch keine einträge in der Combobox.</p>
<p>mach dir nen button mit ner ON_BN_CLICKED funktion und schreib in die funktion die abfrage der combobox.</p>
<p>solltest du jedoch die einträge in der oninit des dialoges via AddString() o. InsertString() in die Combobox setzen kannst du dahinter die abfrage der anzahl setzen da du dafür gesorgt hast das eintäge rechtzeitig in der combobox stehn befor du ne abfrage startest wieviel drinn stehn.</p>
<p>Setz mal folgenden code in deine OnInitDialog() funktion<br />
wirst sehn es funzt <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>CComboBox* pBox = (CComboBox*)GetDlgItem(IDC_COMBOBOX);

pBox-&gt;InsertString(0,&quot;A&quot;);
pBox-&gt;InsertString(1,&quot;B&quot;);
pBox-&gt;InsertString(2,&quot;C&quot;);
pBox-&gt;InsertString(3,&quot;D&quot;);

int nCount = pBox-&gt;GetCount();

CString s;
s.Format(&quot;%i&quot;,nCount);
MessageBox(s);
</code></pre>
<p>[NEW EDIT]<br />
kann aber auch sein das du nur ein simples UpdateData(TRUE) vergessen hast befor du die anzahl abfrägst.</p>
<p>mfg<br />
LowFly</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1119223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1119223</guid><dc:creator><![CDATA[LowFly]]></dc:creator><pubDate>Thu, 17 Aug 2006 13:53:06 GMT</pubDate></item><item><title><![CDATA[Reply to Combobox Anzahl der Einträge on Thu, 17 Aug 2006 14:17:38 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>danke, jetzt funktioniert es. m_combo.clear() sollte doch die Inhalte der Combox löschen, oder?</p>
<p>Danke noch mal.</p>
<p>Grüsse<br />
xthing</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1119252</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1119252</guid><dc:creator><![CDATA[xthing]]></dc:creator><pubDate>Thu, 17 Aug 2006 14:17:38 GMT</pubDate></item><item><title><![CDATA[Reply to Combobox Anzahl der Einträge on Thu, 17 Aug 2006 14:23:06 GMT]]></title><description><![CDATA[<p>löschen mit</p>
<pre><code>m_combo.ResetContent();
</code></pre>
<p>mfg<br />
LowFly</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1119256</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1119256</guid><dc:creator><![CDATA[LowFly]]></dc:creator><pubDate>Thu, 17 Aug 2006 14:23:06 GMT</pubDate></item></channel></rss>