yoy.be "Why-o-Why"

Learn something new every day: set tab width on a plain TMemo

2015-10-09 09:30  TMemoTabWidth  delphi  [permalink]

Strange that I haven't thought of this before, but it's surprisingly easy to do:

var
  TabWidth:cardinal;
begin
  TabWidth:=12;//override the default of 32 'units'
  Memo1.Perform(EM_SETTABSTOPS,1,integer(@TabWidth));
end;

If you want/need to you can pass an array of tab-stop positions instead if just the one (but use integer(@TabWidths[0]) then).

See also EM_SETTABSTOPS