设置Richedit的Tab位

字体大小: 中小 标准 ->行高大小: 标准
设置richedit的段落格式(TAB):

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 31 do

info.rgxTabs[i]:=(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;

对于Memo也是一样的

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/68381.html