>>276
まあケチ付けるだけなのもあれなんで
俺ならこうかなあ
無駄なフィールドを作らないために無理矢理ラムダ式使ってるけど本当はこういうのよくないかも

class TextBoxEx:TextBox
{
  protected string GetIndent(int line)
  {
    var s = Lines[line];
    var m = Regex.Match(s, @"^[  \t]*");
    return m.Value;
  }

  protected string GetIndent()
  {
    return GetIndent(CaretLine);
  }

  public int CaretLine
  {
    get { return GetLineFromCharIndex(SelectionStart); }
  }