trichview.com

trichview.support




space between 2 lines


Return to index


Author

Message

Jürgen

Posted: 01/14/2005 19:50:44


Hello,


I have copied a text from Word to RichViewEdit.


The font.size of the last line is 14.


Then I add some lines (in RVE) in a smaller font. All ok up to the space

between the added lines.


Is there any chance to get smaller line-space between the added lines ?


Jürgen



By the way, Sergey answered to the problem ‘How many lines shown in a memo’


procedure TForm1.Button1Click(Sender: TObject);

var i: integer;

begin

memo.Format;

i:=HowManyLines(memo,memo.height);

showMessage(intToStr(i));

end;



function TForm1.HowManyLines(rv: TCustomRichView; MaxHeight: Integer): Integer;

var i: Integer;         //zählt immer ab MemoBeginn korrekt (also die 1.

Seite)

begin

  Result := 0;

  for i := 0 to rv.RVData.DrawItems.Count-1 do

    // for i := von to rv.RVData.DrawItems.Count-1 do   //zählt bei von nicht

korrekt

    if rv.RVData.DrawItems[i].FromNewLine then begin

      if rv.RVData.DrawItems[i].Top + rv.RVData.DrawItems[i].Height > MaxHeight

then exit;

      inc(Result);

    end;

end;



It counts how many line are included in the MaxHeight completely

(if you need to count lines included partially, "+ rv.RVData.DrawItems[i].Height")


But this calculation can be performed only after the document is formatted

(for DBRichViewEdit, it means it's already displayed)


The function return a number of lines on the screen (it depends on word wrapping),

not a number of items or a number of paragraphs.





Powered by ABC Amber Outlook Express Converter