How To Disable the ENTER Key BEEP in a VB Text Box
Article ID: 140882
Article Last Modified on 3/14/2005
APPLIES TO
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic for Applications 5.0
- Microsoft Visual Basic for Applications 6.0
This article was previously published under Q140882
SUMMARY
In a Microsoft Visual Basic for Windows text box, the ENTER key causes a warning beep to sound only if the MultiLine property is set to False (the default) and the Warning Beep option is selected in the Sound dialog box of the Windows Control panel.
To disable the beep, in the KeyPress event procedure for the text box, set
the value of KeyAscii (which is a parameter passed to KeyPress) equal to
zero (0) when the user presses the ENTER key.
Keywords: kbhowto KB140882