DevExpress MemoEdit定位到末尾

   1: /// <summary>
   2: /// 追加文本到MemoEdit中
   3: /// </summary>
   4: /// <param name="memoEdit"></param>
   5: /// <param name="strText"></param>
   6: public static void AppendTextToMemoEdit(MemoEdit memoEdit, string strText)
   7: {
   8:     try
   9:     {
  10:         memoEdit.Text = memoEdit.Text + "\r\n" + strText;
  11:         memoEdit.SelectionStart = memoEdit.Text.Length;
  12:         memoEdit.ScrollToCaret();
  13:         Application.DoEvents();
  14:     }
  15:     catch
  16:     {
  17:         return;
  18:     }
  19: }

如果是TextBox控件,可以用 TextBox.AppentText()方法。

posted on 2017-03-21 11:51  jingkunliu  阅读(2147)  评论(0编辑  收藏  举报

导航