I gave up trying to come up with a method that worked correctly for
all fonts and font size settings in Windows.  It appears to be the ultimate
endeavor in self-frustration! <g>  What I do now os key the use of
scrollbars to my toggle for wordwrap as at least that appears to make sense
to most users.  When WordWrap is on, as by default, only the vertical
scrollbar is turned on, but when WordWrap is off I set it the ssBoth.

from: Robert Meek at: [EMAIL PROTECTED] 
dba "Tangentals Design" home of "PoBoy"
freeware Windows apps and utilities
located at: www.TangentalsDesign.com
Proud to be a moderotor for the
"Delphi Programming Lists" at: elists.org 


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Wilfried Mestdagh
Sent: Saturday, September 17, 2005 9:12 AM
To: Delphi-Talk Discussion List
Subject: Re: TMemo finding out if a vertical scrollbar is needed

Hello,

I do it at the moment this way. However it does not seem correct. It
seems the Height does not taken into account the free dots above each
line. In my application I just add 4, but I gues this is depending on
font. Someone has a better idea ?

procedure CheckScrollBar(Memo: TMemo);
begin
   if (Abs(Memo.Font.Height) + 4) * Memo.Lines.Count > Memo.Height then
      Memo.ScrollBars := ssVertical
   else
      Memo.ScrollBars := ssNone;
end;

---
Rgds, Wilfried
http://www.mestdagh.biz

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to