<?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[TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe die OnDrawItem-Methode der TListBox-Komponente verwendet und mich stört nun aber, dass er immernoch diesen blöden Rahmen um das aktuell ausgewählte Item zieht - hier meine Methode:</p>
<pre><code class="language-cpp">void __fastcall TfMain::lbCheatListDrawItem(TWinControl *Control,
      int Index, TRect &amp;Rect, TOwnerDrawState State)
{
        int y=Rect.Top+lbCheatList-&gt;ItemHeight/2-lbCheatList-&gt;Canvas-&gt;TextHeight(&quot;O&quot;)/2;
        lbCheatList-&gt;Canvas-&gt;Font-&gt;Assign(lbCheatList-&gt;Font);
        if(State.Contains(odSelected))
        {
                lbCheatList-&gt;Canvas-&gt;Pen-&gt;Color=clSelRow[Index&amp;1];
                lbCheatList-&gt;Canvas-&gt;Font-&gt;Color=clSelRowText[Index&amp;1];
        }
        else
        {
                lbCheatList-&gt;Canvas-&gt;Pen-&gt;Color=clRow[Index&amp;1];
                lbCheatList-&gt;Canvas-&gt;Font-&gt;Color=clRowText[Index&amp;1];
        }
        lbCheatList-&gt;Canvas-&gt;Brush-&gt;Color=lbCheatList-&gt;Canvas-&gt;Pen-&gt;Color;
        lbCheatList-&gt;Canvas-&gt;Rectangle(Rect);
        lbCheatList-&gt;Canvas-&gt;TextOut(64-9-lbCheatList-&gt;Canvas-&gt;TextWidth(IntToStr(Index+1)),y,Index+1);
        lbCheatList-&gt;Canvas-&gt;Pen-&gt;Color=lbCheatList-&gt;Canvas-&gt;Font-&gt;Color;
        lbCheatList-&gt;Canvas-&gt;MoveTo(64,Rect.Top);
        lbCheatList-&gt;Canvas-&gt;LineTo(64,Rect.Bottom);
        lbCheatList-&gt;Canvas-&gt;TextOut(72,y,lbCheatList-&gt;Items-&gt;Strings[Index]);
        y.~int();
}
</code></pre>
<p>Wie bekomme ich diesen Rahmen weg?</p>
<p>- Windoof</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/101254/tlistbox-ondrawitem-wie-bekomme-ich-den-rahmen-weg</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 08:20:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/101254.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Feb 2005 18:46:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg? on Mon, 14 Feb 2005 18:46:44 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe die OnDrawItem-Methode der TListBox-Komponente verwendet und mich stört nun aber, dass er immernoch diesen blöden Rahmen um das aktuell ausgewählte Item zieht - hier meine Methode:</p>
<pre><code class="language-cpp">void __fastcall TfMain::lbCheatListDrawItem(TWinControl *Control,
      int Index, TRect &amp;Rect, TOwnerDrawState State)
{
        int y=Rect.Top+lbCheatList-&gt;ItemHeight/2-lbCheatList-&gt;Canvas-&gt;TextHeight(&quot;O&quot;)/2;
        lbCheatList-&gt;Canvas-&gt;Font-&gt;Assign(lbCheatList-&gt;Font);
        if(State.Contains(odSelected))
        {
                lbCheatList-&gt;Canvas-&gt;Pen-&gt;Color=clSelRow[Index&amp;1];
                lbCheatList-&gt;Canvas-&gt;Font-&gt;Color=clSelRowText[Index&amp;1];
        }
        else
        {
                lbCheatList-&gt;Canvas-&gt;Pen-&gt;Color=clRow[Index&amp;1];
                lbCheatList-&gt;Canvas-&gt;Font-&gt;Color=clRowText[Index&amp;1];
        }
        lbCheatList-&gt;Canvas-&gt;Brush-&gt;Color=lbCheatList-&gt;Canvas-&gt;Pen-&gt;Color;
        lbCheatList-&gt;Canvas-&gt;Rectangle(Rect);
        lbCheatList-&gt;Canvas-&gt;TextOut(64-9-lbCheatList-&gt;Canvas-&gt;TextWidth(IntToStr(Index+1)),y,Index+1);
        lbCheatList-&gt;Canvas-&gt;Pen-&gt;Color=lbCheatList-&gt;Canvas-&gt;Font-&gt;Color;
        lbCheatList-&gt;Canvas-&gt;MoveTo(64,Rect.Top);
        lbCheatList-&gt;Canvas-&gt;LineTo(64,Rect.Bottom);
        lbCheatList-&gt;Canvas-&gt;TextOut(72,y,lbCheatList-&gt;Items-&gt;Strings[Index]);
        y.~int();
}
</code></pre>
<p>Wie bekomme ich diesen Rahmen weg?</p>
<p>- Windoof</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723283</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723283</guid><dc:creator><![CDATA[Windoof]]></dc:creator><pubDate>Mon, 14 Feb 2005 18:46:44 GMT</pubDate></item><item><title><![CDATA[Reply to TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg? on Tue, 15 Feb 2005 10:05:02 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Vielleicht BorderStyle auf bsNone setzen oder Dein Rectangle etwas grösser zeichnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723730</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Tue, 15 Feb 2005 10:05:02 GMT</pubDate></item><item><title><![CDATA[Reply to TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg? on Tue, 15 Feb 2005 13:39:54 GMT]]></title><description><![CDATA[<p>Nein, nicht den Rahmen der ListBox an sich, sorry, hab mich falsch ausgedrückt. Ich meinte diese Rahmen wenn du etwas auswählst, da siehst du (bei Standard-LBs) dieses Blau und einen Rahmen drum, dieses Punktierte... das will ich weghaben, das gefällt mir nicht <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>
<p>- Windoof</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723942</guid><dc:creator><![CDATA[Windoof (ausgeloggt)]]></dc:creator><pubDate>Tue, 15 Feb 2005 13:39:54 GMT</pubDate></item><item><title><![CDATA[Reply to TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg? on Tue, 15 Feb 2005 21:51:05 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<blockquote>
<p>und einen Rahmen drum, dieses Punktierte... das will ich weghaben, das gefällt mir nicht</p>
</blockquote>
<p>Das dürfte dann wohl der Fokusrahmen sein. Defokusiere die ListBox und der Rahmen sollte verschwinden.</p>
<p>Bis dann denn,<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Nash</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724453</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724453</guid><dc:creator><![CDATA[Nash]]></dc:creator><pubDate>Tue, 15 Feb 2005 21:51:05 GMT</pubDate></item><item><title><![CDATA[Reply to TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg? on Tue, 15 Feb 2005 22:32:46 GMT]]></title><description><![CDATA[<p>Das Problem ist: Ich kann die ListBox nicht defocusieren, da es das einzige zu focusierende Element ist... es muss doch eine Möglichkeit geben diesen Focusrahmen auch ohne zu defocusieren wegzubekommen, alles andere ist eine unprofessionelle &quot;Lösung&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724474</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724474</guid><dc:creator><![CDATA[Windoof]]></dc:creator><pubDate>Tue, 15 Feb 2005 22:32:46 GMT</pubDate></item><item><title><![CDATA[Reply to TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg? on Tue, 15 Feb 2005 22:48:49 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das Rechteck wird mit <strong>TCanvas::DrawFocusRect()</strong> gezeichnet, und damit kann man den auch wieder wegmachen, wenn man genau weiß, für welches Rechteck er gezeichnet wurde.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724485</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Tue, 15 Feb 2005 22:48:49 GMT</pubDate></item><item><title><![CDATA[Reply to TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg? on Tue, 15 Feb 2005 23:06:16 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Windoof schrieb:</p>
<blockquote>
<p>... alles andere ist eine unprofessionelle &quot;Lösung&quot;.</p>
</blockquote>
<p>Oh, Entschuldigung... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /><br />
Na dann würde ich sagen, mach keine halben Sachen und schreibe die ListBox komplett neu, dann kannst Du bestimmen, wann und ob der Fokusrahmen gezeichnet werden soll.</p>
<p>Bis dann denn,<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Nash</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724494</guid><dc:creator><![CDATA[Nash]]></dc:creator><pubDate>Tue, 15 Feb 2005 23:06:16 GMT</pubDate></item><item><title><![CDATA[Reply to TListBox::OnDrawItem - Wie bekomme ich den Rahmen weg? on Wed, 16 Feb 2005 12:38:36 GMT]]></title><description><![CDATA[<p>Das wiederum ist ein zu großer Aufwand... obwohl ich schonmal mit dem Gedanken gespielt habe auch den Scrollbalken zu verändern... dazu allerdings müsste ich wirklich die ListBox neu schreiben... mal schaun... wenn ich mal Langeweile hab vielleicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724768</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724768</guid><dc:creator><![CDATA[Windoof]]></dc:creator><pubDate>Wed, 16 Feb 2005 12:38:36 GMT</pubDate></item></channel></rss>