博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

C#winform: GetLineCount of one control

Posted on 2007-03-26 14:48  Snapping  阅读(240)  评论(0编辑  收藏  举报


  [DllImport("user32.dll")]
  private static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);

  private int GetLineCount(TextBox txt)
  {
   return SendMessage(txt.Handle, 0xBA, 0, 0);
  }