Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

Call Function Wtih Key Stroke

I have a function on my WinForm that basically just loads a DataGrid.

I want the user to be able to hit the F5 button to refresh the grid if they want.  IS this possible?
0
chrisryhal
Asked:
chrisryhal
1 Solution
 
jpaulinoCommented:
On KeyDown or KeyUp event you can do:

If e.KeyCode = Keys.F5 Then
  ' your code
End If

Don't forget to set the form property KeyPreview = True

jpaulino
0
 
chrisryhalAuthor Commented:
Solution was perfect
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now