I cannot access Position of the cursor (move mouse programatically)

前端 未结 3 904
花落未央
花落未央 2021-01-25 16:34

this is my code:

    private void MoveCursor(int x, int y)
    {
        // Set the Current cursor, move the cursor\'s Position,
        // and set its clipping          


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-25 17:04

    You probably found your answer already or figured out a workaround, but since I had this same issue I thought I'd post what I discovered.

    The error popped up for me when I added a reference to System.Windows.Forms.DataVisualization.Charting. It seems that the way the cursor works with that reference is different from usual, and overrides the typical Cursor.Position.

    In my case, it was as simple as replacing "Cursor.Position" with "MousePosition".

提交回复
热议问题