When you create desktop application, you will need to create a form that handle keypress event, this functional will help you to trace event on your form application, interest for this event …
For Example when you press Ctrl-D button, application will set more width of your form, and this VB.NET code will help you :
The Step to do this :
1. Set form properties – KeyPreview = True
2. After that copy this code to your application
Private Sub frmMain_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp' will expand the form - for expert toolsIf e.Control AndAlso e.KeyCode = Keys.D ThenMe.Width = 500End If' will collapse the form - for standard toolsIf e.Control AndAlso e.KeyCode = Keys.A ThenMe.Width = 200End IfEnd Sub
No comments:
Post a Comment