I have 2 questions.
The first main question is how do I fix the error I have when trying to invoke the method that contain
KeyEventArgs e
as argument. I only know how to deal with arguments when they are variables.The Second is just a quick question if the
while
loop will do so the program wait for (keydown) before printing the text(label)namespace Test2014 { public partial class Form1 : Form { List<Action> methods = new List<Action>(); public Form1() { InitializeComponent(); // 1. Error invalid arguments methods.Insert(0, test); // 1. passing ( KeyEventArgs e ) as argument ? } private void button1_Click(object sender, EventArgs e) { methods[0].Invoke(); } void test(KeyEventArgs e) // 1. passing ( KeyEventArgs e ) as argument ? { while (true) { if (e.KeyCode == Keys.A) // 2. do this work as wait for keydown before moving down ? break; } // 2. label_test.Text = "When Loop is broken (key down(A)) change this label"; } } }