0
我工作的一个塔防的一类考试连同我的一个朋友。而且我想我会用“PointToClient”要得到光标所在的位置与塔派当过,我们希望把它放下。但它不太有效。我不断收到错误:PointToClient不起作用。 (中错误的详细信息。)
'Vp.PlaceTower'未包含'PointToClient'的定义,也没有找到接受'Vp.PlaceTower'类型的第一个参数的扩展方法'PointToClient'(您是否缺少一个使用指令或程序集引用?)。
的代码如下;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Data;
namespace Vp
{
class PlaceTower : GameWorld
{
private List<Tower> towers = new List<Tower>();
private Point cursorPos;
private Point position;
private Point oldCursorPos;
public void PlaceTower()
{
cursorPos = this.PointToClient(Cursor.Position);
}
}
}
我以前这种方法使用的,所以我只是通过usings检查,但他们都没有“Forms.Control”如何过,如果这是所有我需要做的,我会相当高兴:) – Etarnalazure 2011-12-22 00:43:25
我们走吧,谢谢你的帮助:) – Etarnalazure 2011-12-22 00:49:03
很高兴我可以帮助:) – 2011-12-22 01:00:10