BCB: TextEditor

D

Donata

Hi,

I'm programming in BCB simple text editor in c++. I used TRichEdit control.
The
thing I need is to format the text entered so every line/paragraph entered
would be numbered (1, 2, 3...etc), such thing is in the Kate editor in
Linux. So the thing I found in help was bulletted text or nonbulletted and I
want to have numbers. So far I got only Text bulleted.
I probably must write it by myself using Lines property. The piece of code
below is wat this editor does and three last lines is my idea of
numbering:

void __fastcall TForm1::FormCreate(TObject *Sender)
{
FileName = "untitled.txt";
StatusBar1->Panels->Items[0]->Text=FileName;
RichEdit1->Clear();
//RichEdit1->Paragraph->Numbering = nsBullet;//
int i=1;
for(i=1; i<RichEdit1->Lines->Count; i++)//Count lines and increase
{RichEdit1->Lines += 1}//here I want each paragraph/line to be
numbered from 1 but when I compile this code nothing happens so sth must be
wrong
}

I know that for every pressed enter in RichEdit control I want the program
to number me each line, but i don't quiete know how to code it. I must say I
am newbie in programming in c++ and even more in programming in Borland c++
builder.
Pls be indulgent. I would appreciate any help, good hints about coding this.
THANK YOU VERY MUCH IN ADVANCE.

Ps. Regarding wat i found in help, such code:RichEdit1->Paragraph->Numbering
= nsBullet
I understand wat it does, but wat this 'ns' means before 'Bullet' and why is
it there. Can't there be only Bullet?? THX
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,166
Messages
2,570,902
Members
47,442
Latest member
KevinLocki

Latest Threads

Top