Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Jul : EM_SETTABSTOPS message

www.cryer.info
Managed Newsgroup Archive

EM_SETTABSTOPS message

Subject:EM_SETTABSTOPS message
Posted by:"Richard Bibby" (richard.bib..@profdoc.se)
Date:Tue, 12 Jul 2005 09:52:03

Hej,

I want to set the tab positions in a TRichEdit control at exactly 1/4 inch.
( I think the default is 1/2 inch)?

If pixels per inch is 72 then a 1/4 inch is 18.  So I have tried

   FTabWidth := 18 ;
  SendMessage(Editor.Handle, EM_SETTABSTOPS, 1, Longint(@FTabWidth));

which sets the tabstops in the control, but not at 1/4 inch....

If I set FTabWidth to 19 it gets better but is still not 100% correct, and
FTabWidth at 20 is too long.

Is this due to rounding errors in the RichEdit control? Any tips?

/Richard

Replies:

www.cryer.info
Managed Newsgroup Archive