<?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[Mehrere Forms nebeneinander + Syntaxhighlight]]></title><description><![CDATA[<p>Hey @all,</p>
<p>und zwar hätte ich zu einem zukünftigen Projekt einigen Fragen.<br />
Sorry, falls diese Fragen schon gestellt wurden, aber leider funktioniert die Suchfunktion schon längere Zeit nicht.</p>
<p>1. Ist es möglich/einfach in einem TRichEdit Syntaxhighlight zu realisieren?<br />
2. Wie kann man es realisieren, das man mehrere Forms nebeneinander hat wie beispielsweise beim BCB, Dreamweaver, usw.</p>
<p>Vielen Dank im Voraus<br />
Lg _freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/80837/mehrere-forms-nebeneinander-syntaxhighlight</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 17:28:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/80837.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Jul 2004 15:31:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mehrere Forms nebeneinander + Syntaxhighlight on Sun, 25 Jul 2004 15:31:52 GMT]]></title><description><![CDATA[<p>Hey @all,</p>
<p>und zwar hätte ich zu einem zukünftigen Projekt einigen Fragen.<br />
Sorry, falls diese Fragen schon gestellt wurden, aber leider funktioniert die Suchfunktion schon längere Zeit nicht.</p>
<p>1. Ist es möglich/einfach in einem TRichEdit Syntaxhighlight zu realisieren?<br />
2. Wie kann man es realisieren, das man mehrere Forms nebeneinander hat wie beispielsweise beim BCB, Dreamweaver, usw.</p>
<p>Vielen Dank im Voraus<br />
Lg _freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/post/567868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/567868</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Sun, 25 Jul 2004 15:31:52 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Forms nebeneinander + Syntaxhighlight on Sun, 25 Jul 2004 16:15:23 GMT]]></title><description><![CDATA[<p>für Syntaxhighlighting:http:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39173" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic.php?t=39173</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/567927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/567927</guid><dc:creator><![CDATA[tuxman]]></dc:creator><pubDate>Sun, 25 Jul 2004 16:15:23 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Forms nebeneinander + Syntaxhighlight on Sun, 25 Jul 2004 16:15:56 GMT]]></title><description><![CDATA[<ol>
<li>Siehe <a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39305" rel="nofollow">FAQ</a> unter &quot;RichEdit&quot;.</li>
<li>Einfach mehrere Forms in das Projekt einbinden und per Show() anzeigen.</li>
<li>In Zukunft bitte die Faustregel beachten: ein Thema pro Thread, ein Thread pro Thema. Danke!</li>
</ol>
]]></description><link>https://www.c-plusplus.net/forum/post/567931</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/567931</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 25 Jul 2004 16:15:56 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Forms nebeneinander + Syntaxhighlight on Sun, 25 Jul 2004 16:38:22 GMT]]></title><description><![CDATA[<p>OK, also ich habe mir das jetzt mal durchgelesen, jedoch irgendwie verstehe ich da glaube ich was falsch, hier mal der komplette code:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit2.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm2 *Form2;
char* Keywords[8] = {&quot;for&quot;, &quot;int&quot;, &quot;while&quot;, &quot;do&quot;,
                     &quot;switch&quot;, &quot;break&quot;, &quot;case&quot;, &quot;if&quot;};
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner) {
}
//---------------------------------------------------------------------------
.
.
.
//---------------------------------------------------------------------------

int __fastcall TForm2::GetFirstPos(int Line) {
  int Pos = RichEdit1-&gt;Perform(EM_LINEINDEX, Line, 0);
  return Pos;
}

int __fastcall TForm2::GetLastPos(int Line) {
 if(Line == RichEdit1-&gt;Lines-&gt;Count - 1)
   return RichEdit1-&gt;Text.Length();
 else {
   int Pos = RichEdit1-&gt;Perform(EM_LINEINDEX, Line + 1, 0);
   return (Pos - 1);
 }
}

void __fastcall TForm2::highlightText() {
  int CurrentLine = RichEdit1-&gt;Perform(EM_LINEFROMCHAR, -1, 0);
  int Start = GetFirstPos(CurrentLine);
  int End = GetLastPos(CurrentLine);

  ::FINDTEXT FindText;
  FindText.lpstrText = Keywords[8];
  FindText.chrg.cpMin = Start;
  FindText.chrg.cpMax = End;
  int FoundPos = RichEdit1-&gt;Perform(EM_FINDTEXT, FT_WHOLEWORD, (LPARAM)&amp;FindText);
  AnsiString tmp;
  tmp.cat_sprintf(&quot;Start: %d, End: %d, FoundPos: %d&quot;, Start, End, FoundPos);
  Application-&gt;MessageBoxA(tmp.c_str(), &quot;&quot;, MB_OK);
  while(FoundPos &gt; -1) {
    int CurrentLine = RichEdit1-&gt;Perform(EM_LINEFROMCHAR, -1, 0);
    int Start = GetFirstPos(CurrentLine);
    int End = GetLastPos(CurrentLine);
  }
}

void __fastcall TForm2::Button1Click(TObject *Sender) {
  highlightText();
}
</code></pre>
<p>Bei mir kommt bei FindPos immer -1 raus.</p>
<p>Edit: Habe Code etwas gekürzt<br />
Lg _freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/post/567953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/567953</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Sun, 25 Jul 2004 16:38:22 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Forms nebeneinander + Syntaxhighlight on Sun, 25 Jul 2004 16:49:41 GMT]]></title><description><![CDATA[<p><em>freeze</em> schrieb:</p>
<blockquote>
<pre><code class="language-cpp">FindText.lpstrText = Keywords[8];
</code></pre>
</blockquote>
<p>Damit greifst du auf den neunten String zu, dein Array enthält aber nur acht (Index 0 - 7).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/567964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/567964</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 25 Jul 2004 16:49:41 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Forms nebeneinander + Syntaxhighlight on Sun, 25 Jul 2004 17:08:50 GMT]]></title><description><![CDATA[<p>oik, alles klar, dann werde ich es in einer schleife machen, aber der syntax war etwas neu für mich</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/567982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/567982</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Sun, 25 Jul 2004 17:08:50 GMT</pubDate></item></channel></rss>