Quantcast
Viewing all articles
Browse latest Browse all 12583

How to Detect Pressing F5 in a ProcessKeyPreview Override Method

I am trying to detect pressing F5 in an override of ProccessKeyPreview in which you get a "Message" object. I know you can cast the Message object to "Keys" and compare it with Keys.F5, but this does not work because pressing the letter 't' also satisfies the condition:

if ((Keys)m.WParam  == Keys.F5)
{

}

The issue is that pressing 't' or F5 will both satisfy the condition because they both evaluate to: 116


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>