|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Keypress Event not Firing for enter keyusual add/delete/edit/save buttons and a few textboxes. I capture the keypress events on the textboxes to allow only numbers and I also capture the Enter key to move focus to the next control. The forms work fine if only one form is opened. If both forms are opened and I then switch to the form that was opened first the keypress event does not capture the enter key but the the other characters work. The keypreview property is set to true for all forms. I am at a dead end here and cannot figure it out, can someone please help. keypress code: Private Sub editUserID_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles editUserID.KeyPress Dim Numbers As String = "1234567890" + Microsoft.VisualBasic.ChrW(13) _ + Microsoft.VisualBasic.ChrW(8) If InStr(Numbers, e.KeyChar) = 0 Then MessageBox.Show("Invalid character, Only numbers are allowed!", "Input Error", _ MessageBoxButtons.OK, MessageBoxIcon.Information) e.Handled = True End If If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then SendKeys.Send("{TAB}") e.Handled = True End If End Sub I forgot to mention that all fields are disabled when the form is loaded and
enabled only when the add/edit buttons are clicked. "JAG711" <JAG***@discussions.microsoft.com> wrote in message Does either Form have the AcceptButton property set?news:3717A672-820C-479F-ACE2-D4A4C8AC90AC@microsoft.com... > I capture the keypress events on the textboxes to allow only numbers > and I also capture the Enter key to move focus to the next control. > The forms work fine if only one form is opened. If both forms are > opened and I then switch to the form that was opened first the > keypress event does not capture the enter key but the the other > characters work. This seems to "steal" the Enter keypress on that Form. HTH, Phill W. No none of the forms have the AcceptButton property set?
Show quoteHide quote "Phill. W" wrote: > Does either Form have the AcceptButton property set? > This seems to "steal" the Enter keypress on that Form. > > HTH, > Phill W. > > >
Why have a DBNull?
SQL Question typeof Process.Start("Winword.exe") problem OutOfMemory exception loading ZIP or JPEG compressed TIFs from file CSV Separator Outlook.Application is not defined. PIA installed and setup correctly. How do you put a hyperlinked text on a blank form Windowless application, pls help. How to debug application? |
|||||||||||||||||||||||