I simply quit using TMemo, but I use TRichEdit instead, with PlainText set
to True. I set the ScrollBars to ssBoth, but TRichEdit will only show them,
if required.

Actually, to be more precise, I derived a class from TRichEdit, allowing the
control to be used as a plain text control completely, that is without richt
text features. For example, I reimplemented clipboard message handling to
always use plain text.

Peter Laman
Senior Software Engineer
Lance ICT Group
Roermond, the Netherlands
http://www.lance-safety.com
-
"Nobody ever died of hard work", they say. But why take the risk? (Ronald
Reagan)

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Robert Meek
Sent: zondag 18 september 2005 03:55
To: 'Delphi-Talk Discussion List'
Subject: RE: TMemo finding out if a vertical scrollbar is needed


        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

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

Reply via email to