<?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[Listbox Stil ändern]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Ich habe in einem Dialog eine Listbox mit einfacher Auswahl.<br />
Nun möchte ich programmgesteuert Mehrfachauswahl. Wie mach ich das???<br />
Habe folgenden Anfängerversuch unternommen:</p>
<pre><code class="language-cpp">case WM_INITDIALOG:
	...
	HWND hLB = ::GetDlgItem(hDlg, ID_LISTBOX1);
	::SetWindowLong(hLB, GWL_STYLE, ::GetWindowLong(hLB, GWL_STYLE) | LBS_EXTENDEDSEL);
	//Der neue Stil wird wunderbar akzeptiert,
	//wie man bei ein späteren Aufrufen von ::GetWindowLong(hLB, GWL_STYLE) sieht,
	//hat jedoch keinerlei Effekt - noch immer nur Einfachauswahl!
	//Auch das in der MSDN vorgeschlagene SetWindowPos() nutzt nichts
	::SetWindowPos(hLB, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);

//Dialogvorlage in RC-Datei
IDD_DIALOG1 DIALOG DISCARDABLE  0, 0, 232, 126
STYLE DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION
FONT 8, &quot;MS Sans Serif&quot;
BEGIN
	LISTBOX         ID_LISTBOX1,12,22,158,63,LBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
	PUSHBUTTON      &quot;OK&quot;,IDOK,25,100,50,14,BS_CENTER
END
</code></pre>
<p>Leider hat das überhaupt keine Auswirkungen auf die Listbox! Was mache ich falsch??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/74734/listbox-stil-ändern</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 22:00:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/74734.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 24 May 2004 10:21:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 10:21:11 GMT]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Ich habe in einem Dialog eine Listbox mit einfacher Auswahl.<br />
Nun möchte ich programmgesteuert Mehrfachauswahl. Wie mach ich das???<br />
Habe folgenden Anfängerversuch unternommen:</p>
<pre><code class="language-cpp">case WM_INITDIALOG:
	...
	HWND hLB = ::GetDlgItem(hDlg, ID_LISTBOX1);
	::SetWindowLong(hLB, GWL_STYLE, ::GetWindowLong(hLB, GWL_STYLE) | LBS_EXTENDEDSEL);
	//Der neue Stil wird wunderbar akzeptiert,
	//wie man bei ein späteren Aufrufen von ::GetWindowLong(hLB, GWL_STYLE) sieht,
	//hat jedoch keinerlei Effekt - noch immer nur Einfachauswahl!
	//Auch das in der MSDN vorgeschlagene SetWindowPos() nutzt nichts
	::SetWindowPos(hLB, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);

//Dialogvorlage in RC-Datei
IDD_DIALOG1 DIALOG DISCARDABLE  0, 0, 232, 126
STYLE DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION
FONT 8, &quot;MS Sans Serif&quot;
BEGIN
	LISTBOX         ID_LISTBOX1,12,22,158,63,LBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
	PUSHBUTTON      &quot;OK&quot;,IDOK,25,100,50,14,BS_CENTER
END
</code></pre>
<p>Leider hat das überhaupt keine Auswirkungen auf die Listbox! Was mache ich falsch??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/526174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526174</guid><dc:creator><![CDATA[Krösus]]></dc:creator><pubDate>Mon, 24 May 2004 10:21:11 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 11:03:28 GMT]]></title><description><![CDATA[<p>AFAIK lässt sich der Auswahltyp-Style bei Listboxen nicht ändern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/526202</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526202</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 24 May 2004 11:03:28 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 12:05:17 GMT]]></title><description><![CDATA[<p>wie wäre es denn mit einer listview<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/listview.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/listview.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/526229</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526229</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 24 May 2004 12:05:17 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 12:19:05 GMT]]></title><description><![CDATA[<p>Geht es dir um die Erstellung (kannst du doch auf der Eigenschaftsseite des Listenfeldes) auswählen, oder darum, wie du jetzt über den Quelltext mehrere Einträge markierst?</p>
<p>siehe auch: <a href="http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/listboxes/usinglistboxes.asp" rel="nofollow">Using List Boxes</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/526240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526240</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 24 May 2004 12:19:05 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 12:28:10 GMT]]></title><description><![CDATA[<p>Danke für die Tips!<br />
Einmal erzeugt läßt sich tatsächlich bei einer Listbox so gut wie nichts mehr ändern. Werde dann eben doch die Vorlage in der RC-Datei anfassen müssen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/526250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526250</guid><dc:creator><![CDATA[Krösus]]></dc:creator><pubDate>Mon, 24 May 2004 12:28:10 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 12:50:10 GMT]]></title><description><![CDATA[<p>Wie kommst du darauf, dass sich da nichts mehr ändern liese <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
Schau dir mal <a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windowclasses/windowclassreference/windowclassfunctions/setwindowlong.asp" rel="nofollow">SetWindowLong</a>(Ptr) an <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>
]]></description><link>https://www.c-plusplus.net/forum/post/526266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526266</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 24 May 2004 12:50:10 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 13:23:06 GMT]]></title><description><![CDATA[<p>Manche Sachen lassen sich aber trotzdem nicht nachträglich noch ändern!!!!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/526294</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526294</guid><dc:creator><![CDATA[!!!!!!!!]]></dc:creator><pubDate>Mon, 24 May 2004 13:23:06 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 13:47:29 GMT]]></title><description><![CDATA[<p>flenders schrieb:</p>
<blockquote>
<p>Wie kommst du darauf, dass sich da nichts mehr ändern liese <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
</blockquote>
<p><a href="http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/ListBoxes/ListBoxReference/ListBoxStyles.asp" rel="nofollow">Hier</a> heißt es:</p>
<p>MSDN schrieb:</p>
<blockquote>
<p>After the control has been created, these styles cannot be modified, except as noted.</p>
</blockquote>
<p>flenders schrieb:</p>
<blockquote>
<p>Schau dir mal <a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windowclasses/windowclassreference/windowclassfunctions/setwindowlong.asp" rel="nofollow">SetWindowLong</a>(Ptr) an <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>
</blockquote>
<p>Klappt nicht, sorry. Probier's aus <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>
]]></description><link>https://www.c-plusplus.net/forum/post/526321</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526321</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 24 May 2004 13:47:29 GMT</pubDate></item><item><title><![CDATA[Reply to Listbox Stil ändern on Mon, 24 May 2004 17:28:23 GMT]]></title><description><![CDATA[<p>*duck* - ich hätte mir die Seite wohl doch etwas genauer anschauen sollen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/526466</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526466</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 24 May 2004 17:28:23 GMT</pubDate></item></channel></rss>