Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.11.27;
Скачать: CL | DM;

Вниз

Работа с RichEdit   Найти похожие ветки 

 
netboy   (2005-11-06 13:07) [0]

Здраствуйте! Как сделать нормальную подсветку html - тегов (без глюков)
В моём коде есть глюк : При нажатие Enter каретка идёт вниз, а когда я её подымаю
стрелкой вверх она упраямо опускается в самый низ.
И где можно найти статьи по работе с RichEdit?

Код:----------------------------------------------

procedure HTML(RichEdit: TRichEdit; TextCol : Tcolor);
var
 i, iDop: Integer;
 s: string;
 Col: TColor;

begin

 Col := TextCol;
 RichEdit.SetFocus;

 for i := 0 to Length(RichEdit.Text) do
 begin

   RichEdit.SelStart := i;
   RichEdit.SelLength := 1;
   s := RichEdit.SelText;

   if s = "{" then begin col := cllime end else
   if s = "}" then begin col := clblue end else
   if s = "<" then begin col := clred end else
   if s = ">" then begin col := clred end else
   // .............
    Col := TextCol;

   RichEdit.SelAttributes.Color := Col;
 end;
RichEdit.SelLength := 0;
end;

procedure TForm1.RichEdit1KeyUp(Sender: TObject; var Key: Word;
 Shift: TShiftState);
begin
RichEdit1.Lines.BeginUpdate;
HTML(RichEdit1,clblack);
RichEdit1.Lines.EndUpdate;
end;

-----------------------------------------------------------


 
netboy   (2005-11-07 19:11) [1]

Программисты помогите !!!



Страницы: 1 вся ветка

Текущий архив: 2005.11.27;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.035 c
4-1127720516
DeadMeat
2005-09-26 11:41
2005.11.27
Синхронизация двух процессов


1-1131018624
ancot
2005-11-03 14:50
2005.11.27
Прозрачный TWinControl


5-1112860368
ancara
2005-04-07 11:52
2005.11.27
Как добавить пути к модулям?


2-1131611315
Рафик
2005-11-10 11:28
2005.11.27
Вопрос по Rave Report


14-1131135790
Иксик
2005-11-04 23:23
2005.11.27
Думкин, с Днем Рождения!