.NET 4.x Нет перегруженного метода для "GetCoords", который соответствует делегату "System.EventHandler - C#
Формулировка задачи:
Доброго времени суток.
Помогите решить проблему "Нет перегруженного метода для "GetCoords", который соответствует делегату "System.EventHandler.
"
private void GetCoords(object sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.Z)
{
PointIndex = nowPoint;
try
{
if (offsets.Count > 0)
{
if (selectedOffset.SelectedIndex > -1)
{
Process[] processes = Process.GetProcessesByName(windowName.Text);
if (processes.Length > 0)
{
IntPtr hProcess = processes[0].Handle;
byte[] buffer = new byte[4];
int baseOffset = 0;
for (int h = 0; h < offsets[selectedOffset.SelectedIndex].baseChain.Length; h++)
{
ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].baseChain[h])), buffer, 4, 0);
baseOffset = BitConverter.ToInt32(buffer, 0);
}
ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].dirX)), buffer, 4, 0);
float dirX = BitConverter.ToSingle(buffer, 0);
ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].dirY)), buffer, 4, 0);
float dirY = BitConverter.ToSingle(buffer, 0);
ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].dirZ)), buffer, 4, 0);
float dirZ = BitConverter.ToSingle(buffer, 0);
ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].posX)), buffer, 4, 0);
float posX = BitConverter.ToSingle(buffer, 0);
ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].posY)), buffer, 4, 0);
float posY = BitConverter.ToSingle(buffer, 0);
ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].posZ)), buffer, 4, 0);
float posZ = BitConverter.ToSingle(buffer, 0);
tPosition newPosition = new tPosition();
Cords newCord = new Cords();
newCord.x = posX;
newCord.y = posY;
newCord.z = posZ;
newPosition.from = newCord;
newCord.x = dirX;
newCord.y = dirY;
newCord.z = dirZ;
newPosition.direction = newCord;
Path.pathObjects.points[nowPath].tPositions[nowPoint] = newPosition;
showMoreAboutPath(nowPath);
Points.Rows[PointIndex].Selected = true;
Points.FirstDisplayedScrollingRowIndex = PointIndex;
nowPoint = PointIndex;
showMoreAboutSelectPoint();
}
}
}
else
MessageBox.Show("Нет подходящих оффсетов для этой версии", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (System.Exception ex)
{
}
}
} this.GetCords.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.GetCords.Image = ((System.Drawing.Image)(resources.GetObject("GetCords.Image")));
this.GetCords.Location = new System.Drawing.Point(471, 21);
this.GetCords.Name = "GetCords";
this.GetCords.Size = new System.Drawing.Size(22, 22);
this.GetCords.TabIndex = 14;
this.GetCords.UseVisualStyleBackColor = true;
this.GetCords.Click += new System.Windows.Forms.KeyEventHandler(this.GetCoords);Решение задачи: «.NET 4.x Нет перегруженного метода для "GetCoords", который соответствует делегату "System.EventHandler»
textual
Листинг программы
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GetCoords);