mardi 21 avril 2015

How form can use in keyUp event of the parent form?

I have a problem,First, I have a parent form ("mainForm") and in this there is a KeyUp event (private void MainForm_KeyUp(object sender, KeyEventArgs e)) Second, I have child form(Frm2) than opened by openDialog command, Now I need that Frm2 can use in MainForm_KeyUp. Really, Frm2 comes to MainForm_KeyUp function, but KeyEventArgs e = Keys.Enter and not all my numbers. A comment: the KeyEventArgs Filling up by magnetic Card reader. This is the code:

private void MainForm_KeyUp(object sender, KeyEventArgs e)
{
MessageBox.Show(e.KeyCode.ToString());
if (e.KeyData == Keys.Enter)
{
MessageBox.Show("End");
}
}
Wheמ I swip the card in the reader from the mainForm, I get : "12345END", but from the Frm2, I get "END". The KeyEventArgs parameter not have more keys I have to get "12345END" also from frm2.

I'm really thankful for your trial to help!!!
Soh(a programmer embarrassed :( )

Aucun commentaire:

Enregistrer un commentaire