I've tired to use KeyPress event while in focus of my program's window in VB.Net, but it doesn't work.
For example I wanted to press the number "2" anywhere while in focus of the application and as effect the pixels of the window will change from 200,200 to 600,600 (hortizontal and vertical)
Private Sub Form1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress Form1_KeyPress(Keys.D2) Dim size As Size size = Me.Size Me.Size = New Size(600, 600) End Sub
There seems to be a problem with the "Form1_KeyPress(Keys.D2)" part, what is the correct way to write the code for that?
Thank you very much for your help
This post has been edited by FallenDreamL7: 20 August 2009 - 11:00 PM

New Topic/Question
Reply




MultiQuote



|