1. Home
  2. Computing & Technology
  3. Delphi Programming

Set Tab Stops for TMemo

By , About.com Guide

Here's how to set the first 5 tab stops to 25 pixels each in a TMemo:

~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.FormCreate(Sender: TObject) ;
var
   DialogUnitsX : LongInt;
   PixelsX : LongInt;
   i : integer;
   TabArray : array[0..4] of integer;
begin
   Memo1.WantTabs := true;
   DialogUnitsX := LoWord(GetDialogBaseUnits) ;
   PixelsX := 25;
   for i := 1 to 5 do begin
    TabArray[i - 1] :=
      ((PixelsX * i ) * 4) div DialogUnitsX;
   end;
   SendMessage(Memo1.Handle,
               EM_SETTABSTOPS,
               5,
               LongInt(@TabArray)) ;
   Memo1.Refresh;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» Change printer setup between pages
« Hiding minimized MDI child windows

Explore Delphi Programming
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Using VCL Components
  5. TMemo, TRichEdit
  6. Set Tab Stops for TMemo

©2010 About.com, a part of The New York Times Company.

All rights reserved.