<?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[Radio Button färben]]></title><description><![CDATA[<p>Hallöchen, ich suche eine Möglichkeit einen Radio Button einzufärben...<br />
Hab dieses schon mit OnCtlColor probiert.</p>
<pre><code class="language-cpp">HBRUSH CAirControlSoftView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{

    HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);

    HBRUSH hBGEdit = CreateSolidBrush(RGB(255, 0, 0));

    // Element ermitteln, was geändert werden soll.
    if(pWnd-&gt;GetDlgCtrlID() == IDC_RADIO3)
    {
      pDC-&gt;SetBkMode(RGB(255, 0, 0));
      return hBGEdit;
    }

    return hbr;
}
</code></pre>
<p>Hiermit wird aber nur der Hintergrud gefärbt!!! Möchte aber das der Kreis gefärbt wird, es soll eine Art Statusanzeige sein! Ist das irgendwie möglich???<br />
Oder muss ich einen anderen Weg einschlagen?</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/196973/radio-button-färben</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 01:25:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196973.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Nov 2007 09:51:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Radio Button färben on Mon, 05 Nov 2007 09:51:47 GMT]]></title><description><![CDATA[<p>Hallöchen, ich suche eine Möglichkeit einen Radio Button einzufärben...<br />
Hab dieses schon mit OnCtlColor probiert.</p>
<pre><code class="language-cpp">HBRUSH CAirControlSoftView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{

    HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);

    HBRUSH hBGEdit = CreateSolidBrush(RGB(255, 0, 0));

    // Element ermitteln, was geändert werden soll.
    if(pWnd-&gt;GetDlgCtrlID() == IDC_RADIO3)
    {
      pDC-&gt;SetBkMode(RGB(255, 0, 0));
      return hBGEdit;
    }

    return hbr;
}
</code></pre>
<p>Hiermit wird aber nur der Hintergrud gefärbt!!! Möchte aber das der Kreis gefärbt wird, es soll eine Art Statusanzeige sein! Ist das irgendwie möglich???<br />
Oder muss ich einen anderen Weg einschlagen?</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1397902</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1397902</guid><dc:creator><![CDATA[Torpedo]]></dc:creator><pubDate>Mon, 05 Nov 2007 09:51:47 GMT</pubDate></item><item><title><![CDATA[Reply to Radio Button färben on Mon, 05 Nov 2007 11:52:58 GMT]]></title><description><![CDATA[<p>Siehe Doku zu WM_CTLCOLORBTN<br />
<a href="http://msdn2.microsoft.com/en-us/library/bb761849.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/bb761849.aspx</a></p>
<blockquote>
<p>By default, the DefWindowProc function selects the default system colors for the button. Buttons with the BS_PUSHBUTTON, BS_DEFPUSHBUTTON, or BS_PUSHLIKE styles do not use the returned brush. Buttons with these styles are always drawn with the default system colors. Drawing push buttons requires several different brushes-face, highlight, and shadow-but the WM_CTLCOLORBTN message allows only one brush to be returned. To provide a custom appearance for push buttons, use an owner-drawn button.</p>
</blockquote>
<p>Hier musst Du zu Ownerdraw greifen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1397954</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1397954</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 05 Nov 2007 11:52:58 GMT</pubDate></item></channel></rss>