.NET 4.x Нет перегруженного метода для "GetCoords", который соответствует делегату "System.EventHandler - C#

Узнай цену своей работы

Формулировка задачи:

Доброго времени суток. Помогите решить проблему "Нет перегруженного метода для "GetCoords", который соответствует делегату "System.EventHandler.
Листинг программы
  1. private void GetCoords(object sender, System.Windows.Forms.KeyEventArgs e)
  2. {
  3. if (e.Control && e.KeyCode == Keys.Z)
  4. {
  5. PointIndex = nowPoint;
  6. try
  7. {
  8. if (offsets.Count > 0)
  9. {
  10. if (selectedOffset.SelectedIndex > -1)
  11. {
  12. Process[] processes = Process.GetProcessesByName(windowName.Text);
  13. if (processes.Length > 0)
  14. {
  15. IntPtr hProcess = processes[0].Handle;
  16. byte[] buffer = new byte[4];
  17. int baseOffset = 0;
  18. for (int h = 0; h < offsets[selectedOffset.SelectedIndex].baseChain.Length; h++)
  19. {
  20. ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].baseChain[h])), buffer, 4, 0);
  21. baseOffset = BitConverter.ToInt32(buffer, 0);
  22. }
  23. ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].dirX)), buffer, 4, 0);
  24. float dirX = BitConverter.ToSingle(buffer, 0);
  25. ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].dirY)), buffer, 4, 0);
  26. float dirY = BitConverter.ToSingle(buffer, 0);
  27. ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].dirZ)), buffer, 4, 0);
  28. float dirZ = BitConverter.ToSingle(buffer, 0);
  29. ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].posX)), buffer, 4, 0);
  30. float posX = BitConverter.ToSingle(buffer, 0);
  31. ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].posY)), buffer, 4, 0);
  32. float posY = BitConverter.ToSingle(buffer, 0);
  33. ReadProcessMemory((IntPtr)hProcess, ((IntPtr)(baseOffset + offsets[selectedOffset.SelectedIndex].posZ)), buffer, 4, 0);
  34. float posZ = BitConverter.ToSingle(buffer, 0);
  35. tPosition newPosition = new tPosition();
  36. Cords newCord = new Cords();
  37. newCord.x = posX;
  38. newCord.y = posY;
  39. newCord.z = posZ;
  40. newPosition.from = newCord;
  41. newCord.x = dirX;
  42. newCord.y = dirY;
  43. newCord.z = dirZ;
  44. newPosition.direction = newCord;
  45. Path.pathObjects.points[nowPath].tPositions[nowPoint] = newPosition;
  46. showMoreAboutPath(nowPath);
  47. Points.Rows[PointIndex].Selected = true;
  48. Points.FirstDisplayedScrollingRowIndex = PointIndex;
  49. nowPoint = PointIndex;
  50. showMoreAboutSelectPoint();
  51. }
  52. }
  53. }
  54. else
  55. MessageBox.Show("Нет подходящих оффсетов для этой версии", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
  56. }
  57. catch (System.Exception ex)
  58. {
  59. }
  60. }
  61. }
"
Листинг программы
  1. this.GetCords.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
  2. this.GetCords.Image = ((System.Drawing.Image)(resources.GetObject("GetCords.Image")));
  3. this.GetCords.Location = new System.Drawing.Point(471, 21);
  4. this.GetCords.Name = "GetCords";
  5. this.GetCords.Size = new System.Drawing.Size(22, 22);
  6. this.GetCords.TabIndex = 14;
  7. this.GetCords.UseVisualStyleBackColor = true;
  8. this.GetCords.Click += new System.Windows.Forms.KeyEventHandler(this.GetCoords);

Решение задачи: «.NET 4.x Нет перегруженного метода для "GetCoords", который соответствует делегату "System.EventHandler»

textual
Листинг программы
  1. this.KeyDown +=  new System.Windows.Forms.KeyEventHandler(this.GetCoords);

ИИ поможет Вам:


  • решить любую задачу по программированию
  • объяснить код
  • расставить комментарии в коде
  • и т.д
Попробуйте бесплатно

Оцени полезность:

6   голосов , оценка 4.167 из 5

Нужна аналогичная работа?

Оформи быстрый заказ и узнай стоимость

Бесплатно
Оформите заказ и авторы начнут откликаться уже через 10 минут
Похожие ответы