Fixed cells

General TRichView support forum. Please post your questions here
Post Reply
Nofate
Posts: 11
Joined: Thu Feb 14, 2008 11:11 am

Fixed cells

Post by Nofate »

Is it possible to make table cells of fixed size?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can include rvtoIgnoreContentWidth and rvtoIgnoreContentHeight in table.Options. In this mode, width and heights of all cells are calculated basing on their BestWidth and BestHeight properties, sizes of cells contents are ignored.
miyomo
Posts: 5
Joined: Fri Apr 13, 2007 6:13 am

Post by miyomo »

Sergey Tkachenko wrote:You can include rvtoIgnoreContentWidth and rvtoIgnoreContentHeight in table.Options. In this mode, width and heights of all cells are calculated basing on their BestWidth and BestHeight properties, sizes of cells contents are ignored.
Hi, Sergey!
Can U post a little demo? Thanks for your help.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Code: Select all

table := TRVTableItemInfo.CreateEx(2, 2, RichViewEdit1.RVData);
table.Options := table.Options + [rvtoIgnoreContentWidth, rvtoIgnoreContentHeight];
for r := 0 to table.RowCount-1 do
  for c := 0 to table.ColCount-1 do begin
    table.Cells[r,c].BestWidth := 100;
    table.Cells[r,c].BestHeight := 100;
  end;
RichViewEdit1.InsertItem('', table);
Now try to insert something large in these table cells. Their widths and heights will not be changed.
Post Reply