Sunday, July 3, 2011

How to Capture Function Key in Window Application

Below code is use for capture F2 key in window form:

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
            if (keyData == Keys.F2)
            {
                object sender=null;
                LinkLabelLinkClickedEventArgs e=null;
                linkLabel1_LinkClicked(sender,e);
            }

            return base.ProcessCmdKey(ref msg, keyData);
}


Taken from this link



No comments:

Post a Comment