试试下面的方法:
var
info:_PARAFORMAT;
i:integer;
begin
info.cbSize:=sizeof(info);
info.dwMask:=$FFFFFF;
sendmessage(richedit1.Handle, EM_GETPARAFORMAT ,0,integer(@(info)));
for i:=0 to 31do
info.rgxTabs:=(richedit1.Font.PixelsPerInch-6)*(i+1);
info.dwMask:=PFM_TABSTOPS;
info.cTabCount:=31;
sendmessage(richedit1.Handle, EM_SETPARAFORMAT ,0,integer(@(info)));
end;
************
procedure SetTabstops()
var
TabStops: array[0..3] of word;
begin
TabStops[0]:=10;
TabStops[1]:=20;
TabStops[2]:=30;
TabStops[3]:=40;
TS:=SendMessage(RichEdit.Handle, EM_SETTABSTOPS, 4, LPARAM(@TabStops));
end;