<?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[CEdit Font ändern]]></title><description><![CDATA[<p>Hallo,<br />
ich habe in meiner von CEdit abgeleiteten Klasse den Font geändert. Wenn ich aber Text (oder einen Teil des Textes) selektiere, wird dieser mit dem alten, ursprünglichen Font dargestellt. Kann mir jemand einen Tip oder Link geben, wie ich dieses Problem in den Griff bekomme??<br />
Im Voraus besten Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/145598/cedit-font-ändern</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 05:27:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/145598.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Apr 2006 13:30:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CEdit Font ändern on Sat, 29 Apr 2006 13:30:50 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich habe in meiner von CEdit abgeleiteten Klasse den Font geändert. Wenn ich aber Text (oder einen Teil des Textes) selektiere, wird dieser mit dem alten, ursprünglichen Font dargestellt. Kann mir jemand einen Tip oder Link geben, wie ich dieses Problem in den Griff bekomme??<br />
Im Voraus besten Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1047733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1047733</guid><dc:creator><![CDATA[Reiner]]></dc:creator><pubDate>Sat, 29 Apr 2006 13:30:50 GMT</pubDate></item><item><title><![CDATA[Reply to CEdit Font ändern on Sat, 29 Apr 2006 13:43:43 GMT]]></title><description><![CDATA[<p>Poste mal bitte den Teil wo du Sie geändert hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1047749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1047749</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Sat, 29 Apr 2006 13:43:43 GMT</pubDate></item><item><title><![CDATA[Reply to CEdit Font ändern on Sat, 29 Apr 2006 15:10:30 GMT]]></title><description><![CDATA[<p>Hallo guenni81,<br />
also, es gibt 2 Member-Variablen:</p>
<pre><code class="language-cpp">LOGFONT		m_lf;
  CFont		  m_font;
</code></pre>
<p>im Konstruktor:</p>
<pre><code class="language-cpp">// Hole aktuellen Font
	::GetObject((HFONT)GetStockObject(DEFAULT_GUI_FONT),sizeof(m_lf),&amp;m_lf);
	m_font.CreateFontIndirect(&amp;m_lf);
</code></pre>
<p>Dann gibts ne Member-Funktion, z.B.</p>
<pre><code class="language-cpp">void CEditMore::SetFontBold(BOOL bBold)
{	
	m_lf.lfWeight = bBold ? FW_BOLD : FW_NORMAL;
	m_font.DeleteObject();
	BOOL bCreated = m_font.CreateFontIndirect(&amp;m_lf);
	RedrawWindow();
}
</code></pre>
<p>Und in der Message-Funktion (WM_CTLCOLOR)</p>
<pre><code class="language-cpp">HBRUSH CEditMore::CtlColor(CDC* pDC, UINT nCtlColor) 
{
  pDC-&gt;SetTextColor ( m_clrText );        // text
  pDC-&gt;SetBkColor   ( m_clrTextBkgnd );   // text bkgnd
  pDC-&gt;SelectObject (&amp;m_font);            // Font
  m_brBkgnd.DeleteObject();
  m_brBkgnd.CreateSolidBrush( m_clrBkgnd );

  return m_brBkgnd;
}
</code></pre>
<p>Vielleicht ist ja die WM_CTLCOLOR-Message die falsche, um den Font aufzurufen?</p>
<p>Danke schon mal für deine Mühe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1047819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1047819</guid><dc:creator><![CDATA[Reiner]]></dc:creator><pubDate>Sat, 29 Apr 2006 15:10:30 GMT</pubDate></item><item><title><![CDATA[Reply to CEdit Font ändern on Sat, 29 Apr 2006 18:34:58 GMT]]></title><description><![CDATA[<p>CWnd::SetFont aufrufen und nicht in OnCtlColor den Font selektieren. Das haut nicht hin!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1047941</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1047941</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 29 Apr 2006 18:34:58 GMT</pubDate></item><item><title><![CDATA[Reply to CEdit Font ändern on Sun, 30 Apr 2006 06:59:41 GMT]]></title><description><![CDATA[<p>Hallo Martin,<br />
vielen Dank, jetzt klappt es!<br />
Das kommt davon, wenn man Code von irgendwo her kopiert...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1048066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1048066</guid><dc:creator><![CDATA[Reiner]]></dc:creator><pubDate>Sun, 30 Apr 2006 06:59:41 GMT</pubDate></item></channel></rss>