TMemo tabstops

Q.  How can the tab stops be set in a TMemo control?

A.   To change the tab stops for a multiline edit control (i.e. a TMemo) send the EM_SetTabStops message to the component.  The Tabs array indicates where the tab stops  will be located.  Since the WParam parameter to SendMessage is 1, then all tab stops will be set to the  value passed in the Tabs array.  Remember to set the WantTabs property of TMemo to True to enable the tabs.

 procedure TForm1.FormCreate( Sender : TObject );
 const
    Tabs : array[ 1..1 ] of Integer = ( 10 );
 begin
   SendMessage( Memo1.Handle, EM_SetTabStops, 1, Longint( @Tabs ) );
 end;