You need to send an EM_SETTABSTOPS message , for example:
static class NativeMethods {
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, ref int lParam);
}
static void SetTabs(TextBox box) {
int lParam = 16;
NativeMethods.SendMessage(box.Handle, 0x00CB, new IntPtr(1), ref lParam);
box.Invalidate();
}
source
share