<?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[CListCtrl Farbanpassung]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich weis, es gibt zu diesem Thema genügend Fragen, aber irgendwie Checke ich das nicht.</p>
<p>Wie kann ich denn die einzelnen Text/Hintergrund Farben eines ClistCtrl unterschiedlich ändern ??</p>
<p>Habe mir auch schon eine seperate Class von CListCtrl abgeleitet, dort gibt es aber eine Funktion OnCostumDraw wie ich hier schon gelesen habe.</p>
<p>Und wie geht es dann weiter, wie bringe ich den Text zum ändern ???</p>
<p>Kann mir jemand helfen ??</p>
<p>Gruß und Danke im voraus<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/81682/clistctrl-farbanpassung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 05:36:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/81682.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Aug 2004 09:19:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CListCtrl Farbanpassung on Tue, 03 Aug 2004 09:19:13 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich weis, es gibt zu diesem Thema genügend Fragen, aber irgendwie Checke ich das nicht.</p>
<p>Wie kann ich denn die einzelnen Text/Hintergrund Farben eines ClistCtrl unterschiedlich ändern ??</p>
<p>Habe mir auch schon eine seperate Class von CListCtrl abgeleitet, dort gibt es aber eine Funktion OnCostumDraw wie ich hier schon gelesen habe.</p>
<p>Und wie geht es dann weiter, wie bringe ich den Text zum ändern ???</p>
<p>Kann mir jemand helfen ??</p>
<p>Gruß und Danke im voraus<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/574071</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/574071</guid><dc:creator><![CDATA[andy_mann]]></dc:creator><pubDate>Tue, 03 Aug 2004 09:19:13 GMT</pubDate></item><item><title><![CDATA[Reply to CListCtrl Farbanpassung on Tue, 03 Aug 2004 11:16:19 GMT]]></title><description><![CDATA[<p>Hmmmmm...</p>
<p>habe es nun hingebracht, dass er die Items Farbig macht...</p>
<pre><code class="language-cpp">void CStatistikLogdatenDialog::OnNMCustomdrawStatistikLogdatenliste(NMHDR *pNMHDR, LRESULT *pResult)
{
	NMLVCUSTOMDRAW* pLVCD = reinterpret_cast&lt;NMLVCUSTOMDRAW*&gt;( pNMHDR );
	// LPNMCUSTOMDRAW pLVCD = reinterpret_cast&lt;LPNMCUSTOMDRAW&gt;(pNMHDR);
	// TODO: Fügen Sie hier Ihren Kontrollbehandlungscode für die Benachrichtigung ein.
	*pResult = 0;

	// First thing - check the draw stage. If it's the control's prepaint
    // stage, then tell Windows we want messages for every item.
    if ( CDDS_PREPAINT == pLVCD-&gt;nmcd.dwDrawStage )
        {
        *pResult = CDRF_NOTIFYITEMDRAW;
        }
    else if ( CDDS_ITEMPREPAINT == pLVCD-&gt;nmcd.dwDrawStage )
        {
        // This is the prepaint stage for an item. Here's where we set the
        // item's text color. Our return value will tell Windows to draw the
        // item itself, but it will use the new color we set here.
        // We'll cycle the colors through red, green, and light blue.
        COLORREF crText;
		 COLORREF crBkgnd;

        if ( (pLVCD-&gt;nmcd.dwItemSpec % 3) == 0 )
		{
            crText = RGB(255,0,0);
			crBkgnd = RGB(255,0,0);
		}
        else if ( (pLVCD-&gt;nmcd.dwItemSpec % 3) == 1 )
		{
            crText = RGB(0,255,0);
			crBkgnd = RGB(0,255,0);
		}
        else
		{
            crText = RGB(128,128,255);
			crBkgnd = RGB(0,0,255);
		}

        // Store the color back in the NMLVCUSTOMDRAW struct.
        pLVCD-&gt;clrText = crText;
		pLVCD-&gt;clrTextBk = crBkgnd;

        // Tell Windows to paint the control itself.
        *pResult = CDRF_DODEFAULT;
        }
}
</code></pre>
<p>Wie kann ich aber jetzt auf ein bestimmtes Item reagieren ??</p>
<p>z.b. wenn ein bestimmtes Wort kommt, soll er es Blau machen..... ???</p>
<p>Gruß<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/574182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/574182</guid><dc:creator><![CDATA[andy_mann]]></dc:creator><pubDate>Tue, 03 Aug 2004 11:16:19 GMT</pubDate></item></channel></rss>