Quantcast
Channel: Receiving and reading out KeyEventArgs event on a class other than a Form - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Theodor Zoulias for Receiving and reading out KeyEventArgs event on...

You could subscribe to the KeyDown event directly in your class: public Player(Playtile position, Form form) : base(position) // <--- form parameter { EntityColor = ElementColors.PlayerColor;...

View Article



Answer by Aybe for Receiving and reading out KeyEventArgs event on a class...

KeyDown is a member of Control so in your case you could subscribe to that event in your Form. Like the following: public partial class Form2 : Form { public Form2() { InitializeComponent();...

View Article

Receiving and reading out KeyEventArgs event on a class other than a Form

I'm currently working on a little game as a WinForms project. The gamefield is build out of a grid of Tiles a Player (a separate class) can move on. I want the player to move with the arrow keys and...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images