<?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[Einsteigerfrage: Hintergrundfarbe bei Dialogen]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>bevor ihr jetzt schreibt 'guck in die faq',<br />
das hab ich gemacht und nix gefunden.<br />
Nun zu meiner Frage:<br />
Wie verändere ich die hintergrundfarbe in einem dialog?</p>
<p>ich hab in OnIniDialog geschrieben</p>
<pre><code class="language-cpp">this-&gt;GetDC()-&gt;SetBkColor(RGB(255,255,255) ); //hintergrund soll weiss
</code></pre>
<p>Aber irgendwie passiert nix. Danke im voraus.<br />
MfG RobRoy</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/43906/einsteigerfrage-hintergrundfarbe-bei-dialogen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 08:58:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/43906.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Jul 2003 17:20:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Einsteigerfrage: Hintergrundfarbe bei Dialogen on Fri, 25 Jul 2003 17:20:54 GMT]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>bevor ihr jetzt schreibt 'guck in die faq',<br />
das hab ich gemacht und nix gefunden.<br />
Nun zu meiner Frage:<br />
Wie verändere ich die hintergrundfarbe in einem dialog?</p>
<p>ich hab in OnIniDialog geschrieben</p>
<pre><code class="language-cpp">this-&gt;GetDC()-&gt;SetBkColor(RGB(255,255,255) ); //hintergrund soll weiss
</code></pre>
<p>Aber irgendwie passiert nix. Danke im voraus.<br />
MfG RobRoy</p>
]]></description><link>https://www.c-plusplus.net/forum/post/317731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/317731</guid><dc:creator><![CDATA[RobRoy]]></dc:creator><pubDate>Fri, 25 Jul 2003 17:20:54 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteigerfrage: Hintergrundfarbe bei Dialogen on Fri, 25 Jul 2003 21:12:51 GMT]]></title><description><![CDATA[<p>SetDialogBkColor(RGB(0,0,0,),RGB(255,255,255));</p>
<p>Codeabschnitt muss in die InitInstance.<br />
Beispiel färbt Background schwarz und Foreground weiß.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/317866</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/317866</guid><dc:creator><![CDATA[cyrano]]></dc:creator><pubDate>Fri, 25 Jul 2003 21:12:51 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteigerfrage: Hintergrundfarbe bei Dialogen on Fri, 25 Jul 2003 22:06:39 GMT]]></title><description><![CDATA[<p>OnCtlColor überschreiben und ein Brush zurückgeben:</p>
<pre><code class="language-cpp">return GetStockObject(WHITE_BRUSH);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/317885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/317885</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Fri, 25 Jul 2003 22:06:39 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteigerfrage: Hintergrundfarbe bei Dialogen on Fri, 25 Jul 2003 22:11:14 GMT]]></title><description><![CDATA[<p>achja, aus der MSDN</p>
<blockquote>
<p>CWinApp::SetDialogBkColor<br />
<strong>This function is obsolete.</strong></p>
<p>Remarks<br />
To set the background color of the dialog box, you must handle WM_CTLCOLOR. This message changes the color of the specified dialog box only.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/317886</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/317886</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Fri, 25 Jul 2003 22:11:14 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteigerfrage: Hintergrundfarbe bei Dialogen on Fri, 15 Aug 2003 07:09:41 GMT]]></title><description><![CDATA[<p>Shlo schrieb:</p>
<blockquote>
<p>achja, aus der MSDN</p>
<blockquote>
<p>CWinApp::SetDialogBkColor<br />
<strong>This function is obsolete.</strong></p>
<p>Remarks<br />
To set the background color of the dialog box, you must handle WM_CTLCOLOR. This message changes the color of the specified dialog box only.</p>
</blockquote>
</blockquote>
<p>Dank WM_CTLCOLOR habe ich jetzt die Funktion OnCtlColor.<br />
Darin kann ich auch <strong>pDC-&gt;SetTextColor(RGB(255, 0, 0));</strong> ausführen.</p>
<p>Jetzt kann ich zwar die Hintergrundfarbe aller Steuerelemente bestimmen, die Farbe des ganzen Dialoghintergrunds bleibt aber unbeeinflusst.</p>
<p>Gibt es dafür eine einfache und schnelle Lösung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332624</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332624</guid><dc:creator><![CDATA[Tino_]]></dc:creator><pubDate>Fri, 15 Aug 2003 07:09:41 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteigerfrage: Hintergrundfarbe bei Dialogen on Fri, 15 Aug 2003 08:13:14 GMT]]></title><description><![CDATA[<p>Einfach und schnell? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Kannst haben. Ist aber ein PFUSCH!</p>
<p>Kommt in die OnPaint() (WM_PAINT)<br />
In den else-Teil</p>
<pre><code class="language-cpp">//Füllfarbe
COLORREF color = RGB(255,0,0);
//Zeichenfläche
CPaintDC dc(this);
//Zeichenbereich
CRect rect;
GetClientRect(&amp;rect);
//Lienienfarbe
CPen pen(PS_SOLID,1,color);
CPen *oldpen = dc.SelectObject(&amp;pen);
//Flächenfarbe
CBrush brush(color);
CBrush *oldbrush = dc.SelectObject(&amp;brush);
//Zeichne ein Rechteck
dc.Rectangle(rect);
//Gib die alten Objecte zurück
dc.SelectObject(oldpen);
dc.SelectObject(oldbrush);
</code></pre>
<p>BYE <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/332655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332655</guid><dc:creator><![CDATA[BigSigi]]></dc:creator><pubDate>Fri, 15 Aug 2003 08:13:14 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteigerfrage: Hintergrundfarbe bei Dialogen on Fri, 15 Aug 2003 09:30:24 GMT]]></title><description><![CDATA[<p>Vielen Dank.</p>
<p>Für meinen Anwendungsfall reicht dies auch erst einmal aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332724</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332724</guid><dc:creator><![CDATA[Tino_]]></dc:creator><pubDate>Fri, 15 Aug 2003 09:30:24 GMT</pubDate></item></channel></rss>