using System.Runtime.InteropServices;
{
[DllImport("user32")]
public static extern bool GetCaretPos(ref System.Drawing.Point lpPoint);
private void GetCurRowNo()
{
try
{
Point P = new Point(0);
GetCaretPos(ref P);
int Pos = txtCmdInput.GetCharIndexFromPosition(P);
m_iCurRowNo = txtCmdInput.GetLineFromCharIndex(Pos);
}
catch
{
m_iCurRowNo = -1;
}
}
}
posted on 2008-12-02 11:16
天书 阅读(798)
评论(0) 编辑 收藏 引用