Based on following code Form Key press Event, after loading form, If I Press F1 key Keypress event doesnt work RRS feed

  • Question

  • private void EditGuestForm_KeyPress(object sender, KeyPressEventArgs e)
                string j=e.KeyChar.ToString();
                if (e.KeyChar ==(char)Keys.F1)
                    ViewGuestForm v = new ViewGuestForm();
                    if (v.ShowDialog() == DialogResult.OK)
                        guestcodetoedit = v.guestcode;
                       GridViewShowGuest.DataSource = classguest.GetGuestbyCode(guestcodetoedit);



    Saturday, February 28, 2015 6:23 AM


All replies

  • I Got it

    Key Press Event Doesnt Capture F1 Key

    I Have to use keydown event

    Saturday, February 28, 2015 12:50 PM
  • Hello,

    It is glad to hear that you got it working and thank you for sharing your solutions & experience here. It will be beneficial for other community members who have similar questions.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 2, 2015 2:03 AM