I'm using TRichViewEdit as a chat history display. I'm inserting each entry in as an HTML Table that simply has one row, two cells. Picture in the left cell, text in the right.
I need to programatically delete the first table in the document. I can't figure out how to do it.
Programatically Delete a table
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
This code assumes that the document is formatted. Do not call rv.Format after it - it's not required.
Code: Select all
For i := 0 to rv.ItemCount-1 do
if rv.GetItemStyle(i)=rvsTable then begin
rv.DeleteParas(i,i);
break;
end;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I fixed it by doing a format:
[/code]
Code: Select all
For i := 0 to FRichView.ItemCount - 1 do begin
if FRichView.GetItemStyle(i) = rvsTable then begin
FRichView.DeleteParas(i,i);
dec(FChatEntries);
FRichview.Format;
break;
end;
end; //for
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: