//关于GetCaretPos的定义,用来获取光标位置DllImport("user32")]
public static extern bool GetCaretPos(ref System.Drawing.Point lpPoint);
System.Drawing.Point CaretPos;
GetCaretPos(ref CaretPos);
//这下两行通不过啊,说受保护级别限制,刚开始学C#,找了半天MSDN不知所谓,哎~~
label1.Left=this.Left+CaretPos.x;
label1.Top=this.Top+CaretPos.y;
public static extern bool GetCaretPos(ref System.Drawing.Point lpPoint);
System.Drawing.Point CaretPos;
GetCaretPos(ref CaretPos);
//这下两行通不过啊,说受保护级别限制,刚开始学C#,找了半天MSDN不知所谓,哎~~
label1.Left=this.Left+CaretPos.x;
label1.Top=this.Top+CaretPos.y;
{
System.Drawing.Point CaretPos;
GetCaretPos(ref CaretPos);
label1.Left=this.Left+CaretPos.x;
label1.Top=this.Top+CaretPos.y;
}
{
System.Drawing.Point CaretPos;
GetCaretPos(ref CaretPos);
label1.Left=this.Left+CaretPos.x;
label1.Top=this.Top+CaretPos.y;
}
即CaretPos.X
即CaretPos.X
~~~~~~~~~~~~~~~~ 说得有道理 如果是的话 那就是习惯问题了
小写表示私有,大写表示公共